package leetcode;

/**
 * https://leetcode.com/problems/rank-teams-by-votes/
 */
public class Problem1366 {
    public String rankTeams(String[] votes) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1366 prob = new Problem1366();
        System.out.println(prob.rankTeams(new String[]{"ABC","ACB","ABC","ACB","ACB"})); // "ABC"
        System.out.println(prob.rankTeams(new String[]{"WXYZ","XYZW"})); // "XWYZ"
        System.out.println(prob.rankTeams(new String[]{"ABC","CBA"})); // "ABC"
        System.out.println(prob.rankTeams(new String[]{"ABDC","CDBA"})); // "ACBD"
        System.out.println(prob.rankTeams(new String[]{"CBDA","ADBC"})); // "ACBD"
        System.out.println(prob.rankTeams(new String[]{"WYXZ","XYZW"})); // "XWYZ"
        System.out.println(prob.rankTeams(new String[]{"ZMNAGUEDSJYLBOPHRQICWFXTVK"})); // "ZMNAGUEDSJYLBOPHRQICWFXTVK"
        System.out.println(prob.rankTeams(new String[]{"BCA","CAB","CBA","ABC","ACB","BAC"})); // "ABC"
        System.out.println(prob.rankTeams(new String[]{"M","M","M","M"})); // "M"
    }
}

@@ -12,16 +12,65 @@
 tcode;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 /**%0A * h
@@ -208,15 +208,421 @@
     
-// TODO
+Map%3CInteger, Map%3CCharacter, Integer%3E%3E map = new HashMap%3C%3E();%0A        for (String vote : votes) %7B%0A            for (int i = 0; i %3C vote.length(); i++) %7B%0A                if (!map.containsKey(i)) %7B%0A                    map.put(i, new HashMap%3C%3E());%0A                %7D%0A                map.get(i).put(vote.charAt(i), map.get(i).getOrDefault(vote.charAt(i), 0) + 1);%0A            %7D%0A        %7D%0A        System.out.println(map);
 %0A   
@@ -910,32 +910,34 @@
 %22%7D)); // %22XWYZ%22%0A
+//
         System.o
@@ -992,32 +992,34 @@
 A%22%7D)); // %22ABC%22%0A
+//
         System.o
@@ -1077,32 +1077,34 @@
 %22%7D)); // %22ACBD%22%0A
+//
         System.o
@@ -1170,16 +1170,18 @@
  %22ACBD%22%0A
+//
         
@@ -1255,16 +1255,18 @@
  %22XWYZ%22%0A
+//
         
@@ -1377,16 +1377,18 @@
 WFXTVK%22%0A
+//
         
@@ -1475,32 +1475,34 @@
 C%22%7D)); // %22ABC%22%0A
+//
         System.o

Update problem 1366