C++ Easy to Understand Solution
Approach:\n1.Initially take vector of empty string and try to add each character from string present in its respective row \n2.Now compare all this string and c
Approach:\n1.Initially take vector of empty string and try to add each character from string present in its respective row \n2.Now compare all this string and check if they are in lexicographical order or not.\n3.If they are not in lexicographical order remove newly added element from each string\n\n```\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& str) {\n        \n        int n=str.size();\n        int m=str[0].size();\n        \n        vector<string>vec(n,""); //To store string in lexicographical order\n       \n        for(int i=0;i<m;i++)\n        {\n            \n            for(int j=0;j<n;j++)\n            {\n                vec[j]+=str[j][i]; //Adding one character from each row \n            }\n          \n            int var=1;\n            \n            for(int j=1;j<n;j++)\n            {\n                if(vec[j]<vec[j-1]) // Checking if all string are in lexicographical order or not\n                {\n                    var=-1;\n                    break;\n                }\n            }\n            \n            if(var==-1) // If string are not in lexicographical order then we willl remove current added elemet from all strings\n            {\n                for(int j=0;j<n;j++)\n                {\n                    vec[j].pop_back();\n                }\n            }\n        }\n        \n        \n        return m-vec[0].size();\n    }\n};\n```
['C', 'C++']