Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- val
- """
- class Solution:
- def twoSum(self, nums: List[int], target: int) -> List[int]:
- mp = {}
- for i, val in enumerate(nums):
- if (target - val) in mp:
- return [mp[target-val], i]
- mp[val] = i
- return [-1,-1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement