private void _minPathSum(int[][] grid, int[][] result, int row, int col) {
        if (row == 0 && col == 0) {
            result[0][0] = grid[0][0];
        }
        if (result[row][col] != -1) {
            return;
        }
        
        int left = Integer.MAX_VALUE, up = Integer.MAX_VALUE;
        if (row > 0) {
            _minPathSum(grid, result, row-1, col);
            left = result[row-1][col];
        }
        if (col > 0) {
            _minPathSum(grid, result, row, col-1);
            up = result[row][col-1];
        }
        result[row][col] = Math.min(left, up) + grid[row][col];
    }