mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-12 18:08:38 +08:00
routine
This commit is contained in:
18
25/12/944.cpp
Normal file
18
25/12/944.cpp
Normal 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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user