Problem 1 and 2

This commit is contained in:
Simon Oberzier committed 2026-01-08 21:34:54 +01:00
1 parent 38460afca7
commit 293fee1fc5
2 files changed
+31

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
dic = {}
for i, val in enumerate(nums):
if target - val in dic:
return [dic[target - val], i]
else:
dic[val] = i