Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def singleNumber(self, nums: List[int]) -> List[int]:
- dic = {}
- for x in nums:
- if x in dic:
- dic[x] += 1
- else:
- dic[x] = 1
- ans = []
- for key,val in dic.items():
- if val == 1:
- ans.append(key)
- return ans
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement