动态规划9(Leetcode63不同路径2)

代码:

class Solution {
    public int uniquePathsWithObstacles(int[][] obstacleGrid) {
        int m = obstacleGrid.length;
        int n = obstacleGrid[0].length;
        int[][] pathNum = new int[m][n];
        if(obstacleGrid[0][0]==1)return 0;
        pathNum[0][0] = 1;
        for(int i=1;i

你可能感兴趣的:(动态规划,算法)