Easy understand for beginner
\n    public int minDeletionSize(String[] strs) {\n        int min = 0;\n        int len= strs.length;\n        String[] sorted = new String[len];\n        oute
```\n    public int minDeletionSize(String[] strs) {\n        int min = 0;\n        int len= strs.length;\n        String[] sorted = new String[len];\n        outer : for (int i = 0, len2 = strs[0].length(); i < len2; ++i) {\n            for (int j = 1; j < len; ++j) {\n                if ((sorted[j - 1] + strs[j - 1].charAt(i)).compareTo((sorted[j] + strs[j].charAt(i))) > 0) {\n                    ++min;\n                    continue outer;\n                }\n            }\n            for (int j = 0; j < len; ++j) {\n                sorted[j] += strs[j].charAt(i);\n            }\n        }\n        return min;\n    }\n```\nimproved version by using boolean array\n```\n    public int minDeletionSize(String[] strs) {\n        int min = 0;\n        int len= strs.length;\n        boolean[] sorted = new boolean[len];\n        outer: for (int i = 0, strLen = strs[0].length(); i < strLen; ++i) {\n            int j;\n            for (j = 1; j < len; ++j) {\n                if (!sorted[j] && strs[j].charAt(i) < strs[j - 1].charAt(i)) {\n                    ++min;\n                    continue outer;\n                }\n            }\n            for (j = 1; j < len; ++j) {\n                if (strs[j].charAt(i) > strs[j - 1].charAt(i)) {\n                    sorted[j] = true;\n                }\n            }\n        }\n        return min;\n    }\n```
['Java']