almost 100% Faster || C++
\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n
\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        int ct=0;\n        vector<int> skips(strs.size(),0); // counts to know at which column our row was already sorted for example if we have abc zaa we have already satisfied condition a<z so we need not to check b<a because there is no need \n        for(int j=0;j<strs[0].size();j++){\n            bool isinvalid=false;\n            for(int i=1;i<strs.size();i++){\n                if(skips[i]){\n                    skips[i]++;\n                }\n                else{\n                    if(strs[i-1][j]<strs[i][j]){\n                        skips[i]++;\n                    }\n                    else if(strs[i-1][j]>strs[i][j]){\n                        isinvalid=true;\n                    }\n                }\n            }\n            if(isinvalid){\n                ct++;\n                for(int k=1;k<strs.size();k++){\n                    skips[k]=max(0,skips[k]-1);\n                }\n            }\n        }\n        return ct;\n    }\n};\n```
['C++']