Delete Columns to Make Sorted LeetCode solution in Java
1class Solution {2public int minDeletionSize(String[] strs) {3int count = 0;4for (int i = 0;5i < strs[0].length();6i++) { // strs[0].length() is used to find the length of the column7for (int j = 0; j < strs.length - 1; j++) {8if ((int) strs[j].charAt(i) <= (int) strs[j + 1].charAt(i)) {9continue;10} else {11count++;12break;13}14}15}16return count;17}18}