You are given an `m x n` integer array `grid`. There is a robot initially located at the top-left corner (i.e., `grid[0][0]`). The robot tries to move to the bottom-right corner (i.e., `grid[m - 1][n - 1]`). The robot can only move either down or right at any point in time.
An obstacle and space are marked as `1` or `0` respectively in `grid`. A path that the robot takes cannot include any square that is an obstacle.
Return the number of possible unique paths that the robot can take to reach the bottom-right corner.
### Constraints
- `m == grid.length`, `n == grid[i].length`
- `1 <= m, n <= 100`
- `grid[i][j]` is `0` or `1`.
### Input Format
- Line 1: Two space-separated integers `m` and `n`.
- Next `m` lines: `n` space-separated integers (0 or 1).
### Output Format
Print the number of unique paths.
Sample Cases
Example 1Sample Case
Input: 3 3
0 0 0
0 1 0
0 0 0
Output: 2
Example 2Sample Case
Input: 2 2
0 1
0 0
Output: 1
Example 3Sample Case
Input: 3 3
0 0 0
0 1 1
0 0 0
Output: 1
Example 4Sample Case
Input: 2 2
1 0
0 0
Output: 0
Constraints
Runtime Limit: 2000 ms per test batch
Memory Limit: 256 MB
Standard I/O stream reading
Official submissions are evaluated against hidden test cases on the server to verify time & memory complexity.