C++ O(m*n) solution
\n# Code\ncpp []\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        int ret = 0;\n        vector<int> sorted(strs.size(), 0); 
\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        int ret = 0;\n        vector<int> sorted(strs.size(), 0); \n        for (int j = 0; j < strs[0].size(); ++j) {\n            bool deletion = false;\n            for (int i = 0; i < strs.size() - 1; ++i) {\n                if (!sorted[i] && strs[i][j] > strs[i + 1][j]) {\n                    deletion = true;\n                    ++ret;\n                    break;\n                }\n            }\n            if (deletion) {\n                continue;\n            }\n            for (int i = 0; i < strs.size() - 1; ++i) {\n                sorted[i] |= (strs[i][j] < strs[i + 1][j]);\n            }\n        }\n        return ret;\n    }\n};\n```
['C++']