aboutsummaryrefslogtreecommitdiffstats
path: root/1897/main.py
blob: 17b268c9cc6e757134669f06b36a295815963e1e (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
26
27
28
#!/usr/bin/env python
import typing


class Solution:
    def makeEqual(self, words: typing.List[str]) -> bool:
        dicts: typing.Dict = {}
        for word in words:
            for c in word:
                if c in dicts:
                    dicts[c] += 1
                else:
                    dicts[c] = 1

        for k, v in dicts.items():
            if v % len(words) != 0:
                return False

        return True


def main():
    solution = Solution()
    print(solution.makeEqual(["abc", "aabc", "bc"]))


if __name__ == "__main__":
    main()