@@ -0,0 +1,885 @@
+package leetcode.longest_common_prefix;%0A%0Apublic class Solution %7B%0A    public String longestCommonPrefix(String%5B%5D strs) %7B%0A    %09if(strs == null %7C%7C strs.length == 0) return %22%22;%0A    %09StringBuilder sb = new StringBuilder();%0A    %09int minlength;%0A    %09if(strs%5B0%5D == null) minlength = 0;%0A    %09else%7B%0A    %09%09minlength = strs%5B0%5D.length();%0A    %09%09for(int i = 1; i %3C strs.length; i++)%7B%0A    %09%09%09minlength = Math.min(minlength, strs%5Bi%5D == null ? 0: strs%5Bi%5D.length());%0A    %09%09%7D%0A    %09%7D%0A    %09for(int i = 0; i %3C minlength; i++)%7B%0A    %09%09char c = strs%5B0%5D.charAt(i);%0A    %09%09for(int j = 1; j %3C strs.length; j++)%7B%0A    %09%09%09if(strs%5Bj%5D.charAt(i) != c) return sb.toString();%0A    %09%09%7D%0A    %09%09sb.append(c);%0A    %09%7D%0A    %09return sb.toString();%0A    %7D%0A    %0A    public static void main(String%5B%5D args)%7B%0A    %09String%5B%5D strs = new String%5B%5D%7B%22abab%22,%22aba%22,%22abc%22%7D;%0A    %09System.err.println(new Solution().longestCommonPrefix(strs));%0A    %7D%0A%7D%0A

Add java solution for 14. Longest Common Prefix