Dark Mode
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Now, we may choose any set of deletion indices, and for each string, we delete all the
For example, if we have an array A = ["babca","bbazb"] and deletion indices {0, 1, 4}, then
Suppose we chose a set of deletion indices D such that after deletions, the final array has
For clarity, A[0] is in lexicographic order (ie. A[0][0] <= A[0][1] <= ... <= A[0][A[0].length
Return the minimum possible value of D.length.
Example 1:
Input: ["babca","bbazb"] Output: 3 Explanation: After deleting columns 0, 1, and 4, the final
Input: ["edcba"] Output: 4 Explanation: If we delete less than 4 columns, the only row won't
Input: ["ghi","def","abc"] Output: 0 Explanation: All rows are already lexicographically
Note:
1 <= A.length <= 100 1 <= A[i].length <= 100