2
public String rankTeams(String[] votes) {4
int teams = votes[0].length();5
Map<Character, int[]> map = new HashMap<>();6
List<Character> chars = new ArrayList<>();8
for (int i = 0; i < teams; i++) {9
char team = votes[0].charAt(i);10
map.put(team, new int[teams]);14
for (int i = 0; i < n; i++) {15
String round = votes[i];16
for (int j = 0; j < round.length(); j++) {17
map.get(round.charAt(j))[j] += 1;23
int[] l1 = map.get(a);24
int[] l2 = map.get(b);25
for (int i = 0; i < l1.length; i++) {28
} else if (l1[i] > l2[i]) {32
return a.compareTo(b);35
StringBuilder sb = new StringBuilder();36
for (char c : chars) {