[JAVA] Fastest Solution (further optimization) with explanation
This solution is potentially the fastest solution (so far) depending on the inputs. If the characters during comparisons are more likely to be different, there 
This solution is potentially the fastest solution (so far) depending on the inputs. If the characters during comparisons are more likely to be different, there is a higher chance of the program ending quickly due to the  if(truth == n) statement. \n\nBasically, we compare each letter in the first column. If they are in order, we need to later find out which strings we can 100% be sure is sorted. For example, if the first column is...,\n\n0. a\n1. b\n2. c\n3. d\n4. d\n5. d\n6. f\n\n\nwe know the entire first column is sorted, but we don\'t know if 3, 4, and 5 are sorted, because they started with the same first letter; they may be out of order in the second column (da, dz, db). We are 100% sure index 0, 1, 2, and 6 are sorted (we don\'t need to check them further anymore, so we set their "sorted" array index to true). We are also sure row 5 is true, since d is before f. In the second iteration (2nd column), we only need to compare index 3 to 4 and index 4 to 5 to find out whether or not 3 and 4 are in sorted order. Each time we are 100% sure something is sorted we increment truth by 1. If we reach a point where truth == n (total number of elements), we know to end the program cause there is no need to compare anymore.\n\n```\nclass Solution {\n    public int minDeletionSize(String[] A) {\n        int n = A.length;\n        if(n == 0) {\n            return 0;\n        }\n        int w = A[0].length();    /* length of each word */\n        int truth = 1; /* we assume the last element is sorted (or first, depending on your code) */\n        int j;\n        boolean[] sorted = new boolean[n - 1]; /* tells us if we know if an element is sorted */\n        int delete = 0;\n        for(int i = 0; i < w; i++) {\n            \n            for(j = 0; j < n - 1; j++) {\n                if(!sorted[j] && (A[j].charAt(i) > A[j + 1].charAt(i))) {\n                    delete++;\n                    break;  /* no need to continue checking, we know the column is not 100% in order */\n                }\n            }\n            \n            if(j < n - 1) {\n                continue;\n            }\n            for(int k = 0; k < n - 1; k++) {\n                if(!sorted[k] && A[k].charAt(i) < A[k + 1].charAt(i)) {\n                    sorted[k] = true;\n                    truth++;\n                }\n            }\n            if(truth == n) {\n                return delete;\n            }\n        }\n        return delete;\n    }\n}\n\n```
[]