@@ -0,0 +1,642 @@
+package leetcode;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * https://leetcode.com/problems/check-if-all-characters-have-equal-number-of-occurrences/%0A */%0Apublic class Problem1941 %7B%0A    public boolean areOccurrencesEqual(String s) %7B%0A        Map%3CCharacter, Integer%3E map = new HashMap%3C%3E();%0A        for (char c : s.toCharArray()) %7B%0A            map.put(c, map.getOrDefault(c, 0) + 1);%0A        %7D%0A        int count = -1;%0A        for (int c : map.values()) %7B%0A            if (count == -1) %7B%0A                count = c;%0A            %7D else if (count != c) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A%7D%0A

Solve problem 1941