Fixing memory challenges, naming, testing mini-agi, smooth retrieval scaling (#166)

This commit is contained in:
Silen Naihin
2023-07-17 22:41:58 -04:00
committed by GitHub
parent c7a5498f0f
commit 12c5d54583
104 changed files with 1022 additions and 187 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