CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Hashing
Two Sum (Hash Drill)
Easy
LeetCode
1/8
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Easy
Hashing
LeetCode #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
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results