upd
This commit is contained in:
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user