Python3 | Beats 100% | O(n * str_len)
Complexity\n- Time complexity:\n O(n * len(strs[0])) \n\n\n# Code\n\nfrom typing import List\n\n\nclass Solution:\n    def minDeletionSize(self, strs: List[str]
# Complexity\n- Time complexity:\n$$ O(n * len(strs[0])) $$\n\n\n# Code\n```\nfrom typing import List\n\n\nclass Solution:\n    def minDeletionSize(self, strs: List[str]) -> int:\n        ans = 0\n        not_okay_set = set[int](range(len(strs)))\n        i = 0\n        while i < len(strs[0]):\n            column_okay = True\n            new_not_okay_set = set[int]()\n            for j in not_okay_set:\n                if j + 1 < len(strs) and strs[j][i] > strs[j + 1][i]:\n                    column_okay = False\n                    break\n                elif j + 1 < len(strs) and strs[j][i] == strs[j + 1][i]:\n                    new_not_okay_set.add(j)\n            if not column_okay:\n                ans += 1\n            else:\n                if len(new_not_okay_set) == 0:\n                    return ans\n                not_okay_set = new_not_okay_set\n            i += 1\n        return ans\n```
['Python3']