Given array of strings, find minimum columns to delete such that each remaining column is sorted lexicographically.

Input: strs=["cba","daf","ghi"] → Output: 1. Delete column 0 (c,d,g is sorted, column 1 b,a,f is not). Input: strs=["a","b"] → Output: 0

For each column index, check if column values are non-decreasing. Count unsorted columns.

public int minDeletionSize(String[] strs) { int count = 0; for (int j = 0; j < strs[0].length(); j++) { for (int i = 0; i + 1 < strs.length; i++) { if (strs[i].charAt(j) > strs[i+1].charAt(j)) { count++; break; } } } return count; }