delete-columns-to-make-sorted-ii- Java Solution
\n\n# Code\njava []\nclass Solution {\n        public int minDeletionSize(String[] strs) {\n        int n = strs.length, m = strs[0].length(), i, j;\n        in
\n\n# Code\n```java []\nclass Solution {\n        public int minDeletionSize(String[] strs) {\n        int n = strs.length, m = strs[0].length(), i, j;\n        int res = 0;\n        \n        boolean[] sorted = new boolean[n];\n        for (j = 0; j < m; j++) {\n            for (i = 0; i < n - 1; i++) {\n                if (!sorted[i] && (strs[i].charAt(j) > strs[i + 1].charAt(j))) {\n                    res++;\n                    break;\n                }\n            }\n            \n            if (i == n - 1) {\n                for (int k = 0; k < n - 1; k++) {\n                    sorted[k] |= strs[k].charAt(j) < strs[k + 1].charAt(j);\n                }\n            }\n        }\n        return res;\n    }\n}\n```
['Array', 'String', 'Greedy', 'Java']