You are given an array of n strings strs, where each string has the same length.
These strings can be arranged into a grid, with each string placed on a separate row.
You want to identify all columns that are not sorted lexicographically from top to bottom.
Return the total number of columns that must be deleted so that every remaining column is lexicographically sorted.
Constraints:
n == strs.length
n
strs[i].length
strs[i] consists of lowercase English letters.
You are given an array of n strings strs, where each string has the same length.
These strings can be arranged into a grid, with each string placed on a separate row.
You want to identify all columns that are not sorted lexicographically from top to bottom.
Return the total number of columns that must be deleted so that every remaining column is lexicographically sorted.
Constraints:
n == strs.length
n
strs[i].length
strs[i] consists of lowercase English letters.