@@ -0,0 +1,1057 @@
+// 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.%0A%0A// Note: You can only move either down or right at any point in time.%0A%0Apublic class Solution %7B%0A    public int minPathSum(int%5B%5D%5B%5D grid) %7B%0A        if(grid.length == 0) return 0;%0A%0A        int row = grid.length;%0A        int col = grid%5B0%5D.length;%0A%0A        int%5B%5D%5B%5D dp = new int%5Brow%5D%5Bcol%5D;%0A%0A        for(int i = 0; i %3C row; i++)%7B%0A        %09if(i == 0)%7B%0A        %09%09dp%5Bi%5D%5B0%5D = grid%5Bi%5D%5B0%5D;%0A        %09%7Delse%7B%0A        %09%09dp%5Bi%5D%5B0%5D = dp%5Bi - 1%5D%5B0%5D + grid%5Bi%5D%5B0%5D;%0A        %09%7D%0A        %7D%0A%0A        for(int j = 0; j %3C col; j++)%7B%0A        %09if(j == 0)%7B%0A        %09%09dp%5B0%5D%5Bj%5D = grid%5B0%5D%5Bj%5D;%0A        %09%7Delse%7B%0A        %09%09dp%5B0%5D%5Bj%5D = grid%5B0%5D%5Bj%5D + dp%5B0%5D%5Bj - 1%5D;%0A        %09%7D%0A        %7D%0A%0A        for(int i = 1; i %3C row; i++)%7B%0A        %09for(int j = 1; j %3C col; j++)%7B%0A        %09%09dp%5Bi%5D%5Bj%5D = dp%5Bi - 1%5D%5Bj%5D %3C dp%5Bi%5D%5Bj - 1%5D? grid%5Bi%5D%5Bj%5D + dp%5Bi - 1%5D%5Bj%5D : grid%5Bi%5D%5Bj%5D + dp%5Bi%5D%5Bj - 1%5D;%0A        %09%7D%0A        %7D%0A%0A        return dp%5Brow - 1%5D%5Bcol - 1%5D;%0A    %7D%0A        %0A    %7D%0A%7D

add minimum path sum solution