码迷,mamicode.com
首页 > 其他好文 > 详细

leetcode1207

时间:2019-10-04 17:23:23      阅读:61      评论:0      收藏:0      [点我收藏+]

标签:tco   sel   port   unique   ons   import   not   else   cti   

 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

 

leetcode1207

标签:tco   sel   port   unique   ons   import   not   else   cti   

原文地址:https://www.cnblogs.com/asenyang/p/11622246.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!