# -*- coding:utf-8 -*-
class Solution:
# 返回[a,b] 其中ab是出现一次的两个数字
def FindNumsAppearOnce(self, array):
# write code here
results={}
for elem in array:
if elem not in results:
results[elem]=1
else:
results[elem]+=1
output=[]
for k,v in results.items():
if v==1:
output.append(int(k))
if len(output)==2:
break
return output
最后
以上就是文静大船最近收集整理的关于python数组中只出现一次的数字的全部内容,更多相关python数组中只出现一次内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复