problem
944. Delete Columns to Make Sorted
题意:其实题意很简单,但是题目的description给整糊涂啦。。。直接看题目标题即可理解。
solution:
class Solution { public: int minDeletionSize(vector<string>& A) { int res = 0; for(int i=0; i<A[0].size(); i++) { for(int j=0; j<A.size()-1; j++) { if(A[j][i]>A[j+1][i]) { res++; break; } } } return res; } };
参考
1. Leetcode_easy_944. Delete Columns to Make Sorted;
2. discuss;
完