Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at any point in time.
思路 :求grid[0][0]到grid[i][j]的最小和,就必須得出以下公式
public class Solution { public int minPathSum(int[][] grid) { int i,j,min; for(i=1;i