Delete Columns to Make Sorted
给一个数组, 里面是同样长度的string, 求这个string组成的grid是否对应的每列都是字典序的
class Solution {
public:
int minDeletionSize(vector<string>& strs) {
int n = strs.size();
int m = strs[0].length();
int res = 0;
for(int i = 0; i < m; i++){
for(int j = 1; j < n; j++) {
if(strs[j - 1][i] > strs[j][i]){
res++;
break;
}
}
}
return res;
}
};