c++(3ms 98%) simple, easy, small
Runtime: 3 ms, faster than 98.25% of C++ online submissions for Delete Columns to Make Sorted II.\nMemory Usage: 10.1 MB, less than 64.91% of C++ online submiss
Runtime: 3 ms, faster than 98.25% of C++ online submissions for Delete Columns to Make Sorted II.\nMemory Usage: 10.1 MB, less than 64.91% of C++ online submissions for Delete Columns to Make Sorted II.\n**General idea:**\n1. in vector v will retain only indexes that will present itself proublem (proublem is : if letters in our indexes is equal we don\'t answer on question : its OK or not ? and we will check all that indexes in vector t) \n2. we will sequentally scan our strings from first column to last column and will have 3 possibilities : \n **a.** if letter in proublem index is great than previous we understand that this column is bad and we need to delete this column : so we will try to do the same with next column\n **b.** if we checked all proublem indexes and not have proublem (and vector t is empty) we have answer\n **c.**  if we checked all proublem indexes and not have proublem (and vector t **isn\'t** empty) we update our vector v to vector t and do from step 2\n```\nclass Solution {\npublic:\n  int minDeletionSize(vector<string>& strs) {\n    if(strs.size() == 1) return 0;\n    vector<int>v;\n    for(int i = 1; i != strs.size(); i++) v.push_back(i);\n    int ans = 0;\n    \n    for(int j = 0; j != strs[0].size(); j++){\n      vector<int>t;\n      for(auto i: v)\n        if(strs[i][j] < strs[i-1][j]) goto mark;\n        else if(strs[i][j] == strs[i-1][j]) t.push_back(i);\n      \n      if(t.empty()) return j - ans;\n      ans++;\n      v = t;\n      \n      mark:;\n    }\n   \n    return strs[0].size() - ans;\n  }\n};\n```
['C', 'C++']