leetcode 每日一题 944. 删列造序
class Solution {
public int minDeletionSize(String[] strs) {
int num = 0;
for (int j = 0; j < strs[0].length(); j++) {
char buf = strs[0].charAt(j);
for (int i = 1; i < strs.length; i++) {
char c = strs[i].charAt(j);
if(buf > c){
num++;
break;
}
buf = c;
}
}
return num;
}
}


浙公网安备 33010602011771号