Skip to content

Conversation

@Temka52
Copy link

@Temka52 Temka52 commented Dec 6, 2024

No description provided.

Copy link
Collaborator

@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
Collaborator

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
Collaborator

Choose a reason for hiding this comment

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

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

@czertyaka
Copy link
Collaborator

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

@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