Why my code given error

google
Tags: #<Tag:0x00007f2427930308>

#1

String prefix=A[0];
for(int i=1;i<A.length;i++) {
while(A[i].indexOf(prefix)!=0) {
prefix=prefix.substring(0,prefix.length()-1);
}
}return prefix;.


#2

this one is passing.
make sure you are using editor java 8 array support.