This commit is contained in:
2026-06-05 22:18:39 +08:00
parent 0aed1528e2
commit 14d05011d5
7 changed files with 169 additions and 7 deletions
@@ -57,6 +57,12 @@ Write your approach here.
#+begin_src python
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
sb = {}
for xi, x in enumerate(nums):
want = target - x;
if want in sb:
return sb[want], xi
sb[x] = xi
#+end_src
** TODO C++