@@ -0,0 +1,416 @@
+%0Apublic class _014LongestCommonPrefix %7B%0A    public String longestCommonPrefix(String%5B%5D strs) %7B%0A        if (strs.length == 0) return %22%22;%0A        String prefix = strs%5B0%5D;%0A        for (int i = 1; i %3C strs.length; i++) %7B%0A        %09while (!strs%5Bi%5D.startsWith(prefix)) %7B%0A        %09%09prefix = prefix.substring(0, prefix.length() - 1);%0A        %09%09if (prefix == %22%22) return %22%22;%0A        %09%7D%0A        %7D%0A        return prefix;%0A    %7D%0A%7D%0A

Add 14 solution