We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09eff76 commit a823ef1Copy full SHA for a823ef1
problems/python/1207.unique-number-of-occurrences.py
@@ -0,0 +1,16 @@
1
+#
2
+# @lc app=leetcode id=1207 lang=python3
3
4
+# [1207] Unique Number of Occurrences
5
6
+from typing import List
7
+# @lc code=start
8
+class Solution:
9
+ def uniqueOccurrences(self, arr: List[int]) -> bool:
10
+ count_dic = {}
11
+ for num in arr:
12
+ count_dic[num] = count_dic.get(num, 0) + 1
13
+ return len(count_dic) == len(set(count_dic.values()))
14
+
15
+# @lc code=end
16
0 commit comments