diff options
-rwxr-xr-x | 1207/main.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/1207/main.py b/1207/main.py new file mode 100755 index 0000000..5b85754 --- /dev/null +++ b/1207/main.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + + +import typing + + +class Solution: + def uniqueOccurrences(self, arr: typing.List[int]) -> bool: + dici = {} + for val in arr: + if val in dici: + dici[val] += 1 + else: + dici[val] = 1 + + return len(dici.values()) == len(set(dici.values())) + + +def main(): + solution = Solution() + print(solution.uniqueOccurences([1, 2, 2, 1, 1, 3])) + + +if __name__ == "__main__": + main() |