955. Delete Columns to Make Sorted II
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python []
class Solution:
    def minDeletionSize(self, strings):
        def check_sorted(arr):
            return all(arr[i] <= arr[i + 1] for i in range(len(arr) - 1))

        deletion_count = 0
        current_state = [''] * len(strings)

        for column in zip(*strings):
            updated_state = current_state[:]
            for index, char in enumerate(column):
                updated_state[index] += char

            if check_sorted(updated_state):
                current_state = updated_state
            else:
                deletion_count += 1

        return deletion_count

```
['Python']