1
class Solution {
2
public boolean makeEqual(String[] words) {
3

4
HashMap<Character, Integer> map = new HashMap<>();
5

6
for (String str : words) {
7

8
for (int i = 0; i < str.length(); i++) {
9
char ch = str.charAt(i);
10

11
map.put(ch, map.getOrDefault(ch, 0) + 1);
12
}
13
}
14

15
for (Character key : map.keySet()) {
16

17
int freq = map.get(key);
18
if (freq % words.length != 0) {
19
return false;
20
}
21
}
22

23
return true;
24
}
25
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0