Leetcode 1207. Unique Number of Occurrences | 0 Comments | 25 Leetcode 1207. Unique Number of Occurrences 文章作者:Tyan博客:noahsnail.com | CSDN | 简书 1. Description 2. Solution解析:Version 1,先统计数字数量,再用map或set判断数量是否重复。 Version 1 12345678910class Solution: def uniqueOccurrences(self, arr: List[int]) -> bool: stat = collections.Counter(arr) temp = {} for value in stat.values(): if value not in temp: temp[value] = 1 else: return False return True Reference https://leetcode.com/problems/unique-number-of-occurrences/ 如果有收获,可以请我喝杯咖啡! 赏 微信打赏 支付宝打赏