You are given an m × n grid. The robot starts at the top-left corner and wants to reach the bottom-right corner.
Some cells contain obstacles (1) and others are empty
(0). The robot can only move right or
down.
Return the number of unique paths from start to finish.
0 = empty, 1 = obstacle)Input: [[0,0,0],[0,1,0],[0,0,0]] Output: 2
Input: [[0,1],[0,0]] Output: 1
Print a single integer representing the total number of unique paths.
No submissions yet.
Discuss dynamic programming with obstacles, edge cases, and space optimization.