From 5d7aa2be6c0772ba7f4aba72cc3acaaa11841fee Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 16 Jan 2024 20:17:56 -0500 Subject: 1207 --- 1207/main.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 1207/main.py 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() -- cgit v1.2.3