public String longestCommonPrefix(String[] strs) {
        if(strs == null || strs.length == 0)
            return "";
        if(strs.length == 1)
            return strs[0];
            
        int length = strs.length;
        String compare = strs[0];
        for(int i=1;i<length;i++)
            compare = this.compare(compare, strs[i]);
       
        return compare;   
    }