package leetcode;

/**
 * https://leetcode.com/problems/reorder-log-files/
 */
public class Problem937 {
    public String[] reorderLogFiles(String[] logs) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem937 prob = new Problem937();
    }
}

@@ -12,16 +12,68 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 /**%0A * h
@@ -215,130 +215,961 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem937 prob = new Problem937(
+List%3CString%3E letterLogs = new ArrayList%3C%3E();%0A        List%3CString%3E digitLogs = new ArrayList%3C%3E();%0A        for (String log : logs) %7B%0A            String s = log.split(%22 %22)%5B1%5D;%0A            if (s.charAt(0) %3E= 'a' && s.charAt(0) %3C= 'z') %7B%0A                letterLogs.add(log);%0A            %7D else %7B%0A                digitLogs.add(log);%0A            %7D%0A        %7D%0A        letterLogs.sort((a, b) -%3E %7B%0A            String aId = a.substring(0, a.indexOf(%22 %22));%0A            String bId = b.substring(0, b.indexOf(%22 %22));%0A            String aLetters = a.substring(a.indexOf(%22 %22));%0A            String bLetters = b.substring(b.indexOf(%22 %22));%0A            int cmp = aLetters.compareTo(bLetters);%0A            if (cmp == 0) %7B%0A                return aId.compareTo(bId);%0A            %7D%0A            return cmp;%0A        %7D);%0A        List%3CString%3E result = new ArrayList%3C%3E();%0A        result.addAll(letterLogs);%0A        result.addAll(digitLogs);%0A        return result.toArray(new String%5B0%5D
 );%0A 

Update problem 937