
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use dynamic programming since, from each cell, you can move to the right or down.
assume dp[i][j] is the number of unique paths to reach (i, j). dp[i][j] = dp[i][j -1] + dp[i - 1][j]. Be careful when you encounter an obstacle. set its value in dp to 0.