CodeMentor.
Ask AIProblemsLearnC++TCSCore CSHRProgress
0Lv 1
ProblemsHashing

Two Sum (Hash Drill)

Easy
LeetCode
1/8
EasyHashingLeetCode #1

Same Two Sum — force the hash solution

No nested loops. Prove you own unordered_map.

Examples

Example 1

Input

4 9
2 7 11 15

Output

0 1
Example 2

Input

3 6
3 2 4

Output

1 2

Stuck? Take a nudge

C++17Autosaves