Leetcode in Java && Oracle
420 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-08_18-21-25.png
32.7 KB
#N944. Delete Columns to Make Sorted
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;
}
}