/* * @lc app=leetcode id=63 lang=java * * [63] Unique Paths II */ // @lc code=start class Solution { public int uniquePathsWithObstacles(int[][] obstacleGrid) { int[][] dp = new int[obstacleGrid.length][obstacleGrid[0].length]; for(int i=0;i=0) { dp[i][j] += dp[i-1][j]; } if(j-1>=0) { dp[i][j] += dp[i][j-1]; } } } return dp[dp.length-1][dp[0].length-1]; } } // @lc code=end