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 Name | Difficulty | Acceptance | Action |
|---|---|---|---|
| No problems found matching "". | |||