This commit is contained in:
2025-12-21 02:24:18 +08:00
parent 31ed535887
commit e0912887c2
3 changed files with 78 additions and 0 deletions

18
25/12/944.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include <string>
#include <vector>
class Solution {
public:
int minDeletionSize(std::vector<std::string>& strs) {
int ans = 0;
for(int i = 0;i<strs[0].size();i++){
for (int j = 1; j < strs.size(); j++) {
if (strs[j][i] < strs[j-1][i]) {
ans++;
break;
}
}
}
return ans;
}
};