Tap here to switch tabs
Problem
Submissions

Problem: Delete Columns to Make Sorted III

med
30 min
Try to solve the Delete Columns to Make Sorted III problem.

Statement

You are given an array of nn strings strs, where all strings have equal length.

You may choose a set of column indices to delete. After deleting the characters at the selected indices from every string, each individual string in strs must be in nondecreasing lexicographical order.

Return the minimum number of column deletions required so that every string in strs satisfies this condition.

Constraints:

  • n ==== strs.length

  • 1≤1 \leq n ≤100\leq 100

  • 1≤1 \leq strs[i].length ≤100\leq 100

  • strs[i] consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Delete Columns to Make Sorted III

med
30 min
Try to solve the Delete Columns to Make Sorted III problem.

Statement

You are given an array of nn strings strs, where all strings have equal length.

You may choose a set of column indices to delete. After deleting the characters at the selected indices from every string, each individual string in strs must be in nondecreasing lexicographical order.

Return the minimum number of column deletions required so that every string in strs satisfies this condition.

Constraints:

  • n ==== strs.length

  • 1≤1 \leq n ≤100\leq 100

  • 1≤1 \leq strs[i].length ≤100\leq 100

  • strs[i] consists of lowercase English letters.