aboutsummaryrefslogtreecommitdiffstats
path: root/1207/main.py
blob: 5b857544d8f8ef1b9d37a0857f96a10fb5f55791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()