leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
0944.cpp (381B)
0 class Solution { 1 public: 2 int minDeletionSize(vector<string> &strs) { 3 int count = 0; 4 for (int i = 0; i < strs[0].size(); i++) { 5 for (int j = 1; j < strs.size(); j++) { 6 if (strs[j][i] < strs[j - 1][i]) { 7 count++; 8 break; 9 } 10 } 11 } 12 return count; 13 } 14 };