Easy to understand (Trivial approach)
Intuition\n Describe your first thoughts on how to solve this problem. \nTo figure out which columns to remove and how to elimnate a string from the vector comp
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTo figure out which columns to remove and how to elimnate a string from the vector completely which is in order.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nPick an index (start with the 1st character of string) check the lexographical order of the 1st character for all the strings if not in order then we need to remove that character(i.e the column). If in order then the ones which are strictly less than the next are in order so no need to check those strings. Hence we marks them visited.\nGo on till you reach you the end.\nRefer the code for better undestanding. \n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(m*n) where m is the length of each string and n is the size of the vector.\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n) for maintaining the visited vector.\n\n# Code\n```\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        int count=0;\n        vector<bool> visited(strs.size(),false);\n        for(int i=0;i<strs[0].length();i++){\n            vector<int> help;\n            bool found=false;\n            for(int j=0;j<strs.size()-1;j++){\n                if(visited[j]){\n                    continue;\n                }\n                if(strs[j][i]<strs[j+1][i]){\n                    help.push_back(j);\n                }\n                else if(strs[j][i]==strs[j+1][i]){\n                    continue;\n                }\n                else{\n                    found=true;\n                    break;\n                }\n            }\n            if(found==true){\n                count++;\n            }\n            else{\n                for(int k=0;k<help.size();k++){\n                    visited[help[k]]=true;\n                }\n            }\n        }\n        return count;\n    }\n};\n```
['C++']