class Solution {
public int minDeletionSize(String[] A) {
String str = A[0];
int countD = 0;
int length = str.length();
for (int i=0; i<length; i++) {
char last = A[0].charAt(i);
for (int j=1; j<A.length; j++) {
char curr = A[j].charAt(i);
if (curr<last) {
countD ++;
break;
}
else
last = curr;
}
}
return countD;
}
}