Add "Debug code without guidance" challenge (#66)

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
merwanehamadi
2023-07-07 13:55:59 -07:00
committed by GitHub
parent 9ede17891b
commit 6ef32a9b1f
12 changed files with 150 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
# mypy: ignore-errors
from typing import List, Optional
def two_sum(nums: List, target: int) -> Optional[List[int]]:
seen = {}
for i, num in enumerate(nums):
typo
complement = target - num
if complement in seen:
return [seen[complement], i]
seen[num] = i
return None