java with 3lines of explanation
class Solution {\n    public int minDeletionSize(String[] strs) {\n        //jsut think in terms of matrix\n        // if previos column is sorted then why do w
class Solution {\n    public int minDeletionSize(String[] strs) {\n        //jsut think in terms of matrix\n        // if previos column is sorted then why do we want to sort the next columns(greedy)\n        //   so we only delete a column if we sure that previous columns are not sorted\n        //        col\n        //  row [    ]\n        boolean sorted [] = new boolean[strs.length];\n        int result = 0;\n        int n = strs[0].length();\n        \n        for (int j = 0; j < strs[0].length(); j++) {\n            \n            int i = 0;\n            for (; i < strs.length - 1; i++) {\n                \n                if (!sorted[i] && strs[i].charAt(j) > strs[i + 1].charAt(j)) {\n                    System.out.println(j);\n                    result++;\n                    break;\n                }\n                \n            }\n            \n            if (i < strs.length - 1) \n                continue;\n            \n            i = 0; \n            for (; i < strs.length - 1; i++) \n                if (strs[i].charAt(j) < strs[i + 1].charAt(j))\n                    sorted[i] = true;\n            \n        }\n        return result;\n        \n    }\n}
[]