Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сокова #25

Closed
wants to merge 2 commits into from
Closed

Сокова #25

wants to merge 2 commits into from

Conversation

annas-creator
Copy link

No description provided.

src/two-sum.hpp Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно было не копировать этот файл из include

src/two-sum.cpp Outdated
bool two_sum(const int nums[ARRAY_SIZE],const int target, std::size_t& index0, std::size_t& index1) {
for (int i = 0; i < ARRAY_SIZE; i++)
{
for (int j = 1; j < ARRAY_SIZE; j++)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше начинать вложенный цикл с i = j + 1. Сейчас в цикле возможно, что i == j, это противоречит условию задачи

@czertyaka
Copy link
Owner

Задание принято

@czertyaka czertyaka closed this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants