leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0944.cpp (381B)


      1 class Solution {
      2   public:
      3     int minDeletionSize(vector<string> &strs) {
      4         int count = 0;
      5         for (int i = 0; i < strs[0].size(); i++) {
      6             for (int j = 1; j < strs.size(); j++) {
      7                 if (strs[j][i] < strs[j - 1][i]) {
      8                     count++;
      9                     break;
     10                 }
     11             }
     12         }
     13         return count;
     14     }
     15 };