题目虽然简单但是要高效准确还是要很细心才是,粗心是BUG的最大制造者。
public class Solution { public String longestCommonPrefix(String[] strs) { if(strs.length == 0) { return ""; } int minLen = strs[0].length(); String minStr = strs[0]; for(int i=1; i=0; i--) { count = 0; ans = minStr.substring(0, i); for(int j=0; j