C#: faster than 100%
Intuition\nGo through all the columns and check.\n\n# Approach\nAdd method\n\nprivate bool IsOK(int col, List<int[]> list, string[] strs)\n\nwhere\n- col: index
# Intuition\nGo through all the columns and check.\n\n# Approach\nAdd method\n```\nprivate bool IsOK(int col, List<int[]> list, string[] strs)\n```\nwhere\n- col: index of column to check\n- list: intervals to check. Initally is equal to [0, strs.Length - 1]\n- strs: initial array of strings\n\nAdd method\n```\nprivate List<int[]> GetNewList(int col, List<int[]> list, string[] strs)\n```\nwith the same parameters as in method `IsOK`. This method check the column col for intervals `list`.\nIf method `IsOK` return false, then we add index of column to the `badIndexes` list.\nAt the end return the number of bad columns:\n```\nreturn badIndexes.Count;\n```\n\n# Complexity\n- Time complexity:\n$$O(len(strs) * len(strs[0]))$$\n\n- Space complexity:\n$$O(len(strs[0]))$$\n\n# Code\n```\npublic class Solution {\n    public int MinDeletionSize(string[] strs) {\n        var list = new List<int[]> { new[] { 0, strs.Length - 1 } };\n        var badIndexes = new List<int>();\n        for (int i = 0; i < strs[0].Length; i++)\n        {\n            var isOK = IsOK(i, list, strs);\n            if (isOK)\n            {\n                if (i < strs[0].Length - 1)\n                {\n                    list = GetNewList(i, list, strs);\n                    if (list.Count == 0) break;\n                }\n            }\n            else\n            {\n                badIndexes.Add(i);\n            }\n        }\n        return badIndexes.Count;\n    }\n    private List<int[]> GetNewList(int col, List<int[]> list, string[] strs)\n    {\n        var rs = new List<int[]>();\n        for (int i = 0; i < list.Count; i++)\n        {\n            var index0 = list[i][0];\n            var index1 = list[i][0];\n            for (int j = list[i][0] + 1; j <= list[i][1]; j++)\n            {\n                if (strs[j - 1][col] == strs[j][col])\n                {\n                    index1 = j;\n                }\n                else\n                {\n                    if (index0 < index1) rs.Add(new[] { index0, index1 });\n                    index0 = j;\n                    index1 = j;\n                }\n            }\n            if (index0 < index1) rs.Add(new[] { index0, index1 });\n        }\n        return rs;\n    }\n    private bool IsOK(int col, List<int[]> list, string[] strs)\n    {\n        for (int i = 0; i < list.Count; i++)\n        {\n            for (int j = list[i][0]; j < list[i][1]; j++)\n            {\n                if (strs[j][col] > strs[j + 1][col]) return false;\n            }\n        }\n        return true;\n    }\n}\n```
['C#']