C++ | 0(N*M) | Easy to understand with Explanation
Three-step to take care of:\n\n1) If same char of \xA0(previous string (i-1) == current string( i) ) or all removed index of string store them in a hash table s
Three-step to take care of:\n\n1) If same char of \xA0(previous string (i-1) == current string( i) ) or all removed index of string store them in a hash table so do nothing as they are lexicographic maintain.\n2) \xA0 previous \xA0string (i-1) > current string( i) , lexicographic greater than current string , remove that index.\n3) \xA0 By removing that index the all the strings can change in lexicographic order, then do start with the first string again.\n\xA0\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        \n        unordered_set<int> seen;\n        int n = strs.size();\n        if(n==0) return 0;\n        int m = strs[0].length();\n        \n        for(int i=1;i<n;i++){\n            for(int j=0;j<m;j++){\n                \n                if(seen.count(j) > 0 || strs[i-1][j] == strs[i][j]) {\n                    continue;\n                }\n                \n                if(strs[i-1][j] > strs[i][j]){\n                    seen.insert(j);\n                    i=0;\n                }\n                break;\n            }\n        }\n        return seen.size();\n    }\n};
[]