剑指offer python版 数组中只出现一次的两个数字

def aa(nums):
    hashes={}
    for s in nums:
        hashes[s]=hashes[s]+1 if hashes.get(s) else 1
    for s in nums:
        if hashes[s]==1:
            print (s)
            
    return 

print(aa([1,2,3,3,3,4,5,5]))

 

posted @ 2018-10-29 10:43  findtruth123  阅读(335)  评论(0编辑  收藏  举报