mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-12 18:08:38 +08:00
18 lines
411 B
C++
18 lines
411 B
C++
#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;
|
|
}
|
|
}; |