题目描述
Python hash表
Python 代码
class Solution(object):
def findNumsAppearOnce(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
dict = {}
for num in nums:
if num in dict:
dict[num] += 1
else:
dict[num] = 1
res = []
for num in dict:
if dict[num] == 1:
res.append(num)
return res