Easiest Solution
\n# Code\njava []\nclass Solution {\n    public int minDeletionSize(String[] strs) {\n       int n=strs.length;\n        int count=0;\n        boolean[] ans=new
\n# Code\n```java []\nclass Solution {\n    public int minDeletionSize(String[] strs) {\n       int n=strs.length;\n        int count=0;\n        boolean[] ans=new boolean[n];\n        for(int i=0;i<strs[0].length();i++){\n            int j=0;\n            for(;j<strs.length-1;j++){\n                if(!ans[j] && strs[j].charAt(i)>strs[j+1].charAt(i)){\n                    count++;\n                    break;\n                }\n            }\n            if(j<strs.length-1){\n                continue;\n            }\n            j=0;\n            for( ;j<strs.length-1;j++){\n                if(strs[j].charAt(i)<strs[j+1].charAt(i)){\n                    ans[j]=true;\n                }\n            }\n        }\n        \n        return count;\n    }\n    \n}\n```\n```c++ []\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) \n    {\n        int ans = 0, len = strs[0].length(), n = strs.size();\n        vector<bool> isdone(n, 0);\n\n        for(int i = 0; i < len; i++)\n        {\n            vector<bool> temp(n, 0);\n            bool flag = 0;\n            for(int j = 0; j < n-1; j++)\n            {\n                if(isdone[j] == 0)\n                {\n                    if(strs[j][i] > strs[j+1][i])\n                    {\n                        ans++;\n                        flag = 1;\n                        break;\n                    }\n                    else if(strs[j][i] < strs[j+1][i])\n                    {\n                        temp[j] = 1;\n                    }\n                }\n            }\n\n            if(!flag)\n            {\n                for(int j = 0; j < n-1; j++)\n                {\n                    isdone[j] = (isdone[j] || temp[j]);\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['C++', 'Java']