class Solution {
public String longestCommonPrefix(String[] strs) {
String re = "";
boolean reee = true;
int index = 0;
if(strs==null||strs.length==0){
return "";
}
while(reee) {
String mm = "";
for(int i=0;i<strs.length;i++) {
if(reee) {
if(strs[i].length()>index) {
if(i==0) {
mm = strs[i].substring(index, index+1);
}else {
if(!mm.equals(strs[i].substring(index, index+1))) {
reee = false;
}
}
}else {
reee = false;
}
}
}
if(reee) {
re+=mm;
}
index++;
}
return re;
}
}