image_2021-11-08_18-21-25.png
32.7 KB
#N944. Delete Columns to Make Sorted
problem link
#solution
problem link
#solution
class Solution {
public int minDeletionSize(String[] strs) {
int count=0;
for(int i=0; i<strs[0].length(); i++){
for(int j=0; j<strs.length-1; j++){
if(strs[j].charAt(i)>strs[j+1].charAt(i)){
count++;
break;
}
}
}
return count;
}
}