def singleNumber(nums):
d={}
l=[]
for i in nums:
if i in d:
d[i]+=1
else:
d[i]=1
for k,v in d.items():
if v==1:
l.append(k)
return l
原文地址:https://www.cnblogs.com/zhangtianxia/p/9030522.html
时间: 2024-10-10 08:16:34