1 import collections
 2 class Solution:
 3     def uniqueOccurrences(self, arr: List[int]) -> bool:
 4         obj = collections.Counter(arr).items()
 5         dic = {}
 6         for o in obj:
 7             if o[1] not in dic:
 8                 dic[o[1]] = o[0]
 9             else:
10                 return False
11         return True

 

posted on 2019-10-04 15:27  Sempron2800+  阅读(157)  评论(0编辑  收藏  举报