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

Баталов Артём Александрович #32

Closed
wants to merge 1 commit into from

Conversation

Temka52
Copy link

@Temka52 Temka52 commented Dec 6, 2024

No description provided.

Copy link
Owner

@czertyaka czertyaka left a comment

Choose a reason for hiding this comment

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

Принято с небольшими замечаниями

#include <iostream>
#include <unordered_map>

#define ARRAY_SIZE 5
Copy link
Owner

Choose a reason for hiding this comment

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

Вместо дублирования определения макроса лучше подключить two-sum.hpp

std::unordered_map<int, std::size_t> num_map;

for (std::size_t i = 0 ; i < ARRAY_SIZE; ++i){
int num2 = target - nums[i];
Copy link
Owner

Choose a reason for hiding this comment

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

Этот объект не меняется и его лучше сделать иммутабельным

@czertyaka
Copy link
Owner

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

@czertyaka czertyaka closed this Dec 8, 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