Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def twoSum(self, nums, target):
- """
- :type nums: List[int]
- :type target: int
- :rtype: List[int]
- """
- for u in range(len(nums)-1):
- if (target-nums[u]) in nums[u+1:]:
- j=nums[u+1:].index(target-nums[u])+u+1
- return [u,j]
Add Comment
Please, Sign In to add comment