Skip to content

Commit 6c8454b

Browse files
committed
addin gupdate
1 parent 6c2430d commit 6c8454b

File tree

1 file changed

+13
-0
lines changed
  • src/my_project/interviews/interview_amazon/round_2

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from typing import List
2+
3+
class Solution:
4+
def twoSum(self, nums: List[int], target: int) -> List[int]:
5+
6+
dic_answer = dict()
7+
8+
for k, v in enumerate(nums):
9+
10+
if v in dic_answer:
11+
return [dic_answer[v], k]
12+
else:
13+
dic_answer[target - v] = k

0 commit comments

Comments
 (0)