package leetcode;

/**
 * https://leetcode.com/problems/minimum-falling-path-sum/
 */
public class Problem931 {
    public int minFallingPathSum(int[][] A) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem931 prob = new Problem931();
        System.out.println(prob.minFallingPathSum(new int[][]{
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        })); // 12
    }
}

@@ -163,32 +163,930 @@
     
-// TODO%0A        return 0
+int maxRow = A.length;%0A        int maxCol = A.length %3E 0 ? A%5B0%5D.length : 0;%0A        int min = Integer.MAX_VALUE;%0A//        for (int col = 0; col %3C maxCol; col++) %7B%0A//            min = Math.min(min, minFaillingPathSum(A, maxRow, maxCol, 0, col));%0A//        %7D%0A        min = Math.min(min, minFaillingPathSum(A, maxRow, maxCol, 0, 0));%0A        return min;%0A    %7D%0A%0A    private static int minFaillingPathSum(int%5B%5D%5B%5D a, int maxRow, int maxCol, int row, int col) %7B%0A        if (row %3C 0 %7C%7C col %3C 0 %7C%7C row %3E= maxRow %7C%7C col %3E= maxCol) %7B%0A            return 0;%0A        %7D%0A        int value = a%5Brow%5D%5Bcol%5D;%0A        int min = Integer.MAX_VALUE;%0A        min = Math.min(min, minFaillingPathSum(a, maxRow, maxCol, row + 1, col - 1) + value);%0A        min = Math.min(min, minFaillingPathSum(a, maxRow, maxCol, row + 1, col) + value);%0A        min = Math.min(min, minFaillingPathSum(a, maxRow, maxCol, row + 1, col + 1) + value);%0A        return min
 ;%0A  

Update problem 931