Sharpen your skills with WeHive

Practice coding challenges, test your algorithms in an isolated sandbox, and collaborate with developers in real time.

solution.py
def two_sum(nums, target):
seen = {}
for i, n in enumerate(nums):
diff = target - n
if diff in seen:
return [seen[diff], i]
seen[n] = i

Trending Problems

0 available
Problem NameDifficultyAcceptanceAction
No problems found matching "".
Your Progress
12Solved
Easy8/50
Med3/70
Hard1/30
3 Days Streak
Practice today to keep it!
Active
Recent Discussions
Sarah
Optimal O(n) solution for Two Sum using Hash Map
Sarah K.•2h ago
Alex
Binary Search edge cases with integer overflow in Java
Alex M.•4h ago
David
Tips for Google Technical Phone Screen 2026
David W.•1d ago