摘要:
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[ 阅读全文
posted @ 2019-10-04 15:27
Sempron2800+
阅读(165)
评论(0)
推荐(0)
摘要:
先将数据排序,然后计算相邻数组的差值,使用字典保存最小差值所包含的元素对。 阅读全文
posted @ 2019-10-04 15:18
Sempron2800+
阅读(163)
评论(0)
推荐(0)
浙公网安备 33010602011771号