Given a 2D integer matrix obstacle_matrix of size m x n, where each cell contains either 0 (free) or 1 (obstacle), compute the number of distinct paths from the top-left cell (0,0) to the bottom-right cell (m-1,n-1). Movement is allowed only to the right or down. Paths cannot pass through cells containing obstacles (1). Return the total number of such unique paths.
Example 1
Input: [[0,0],[1,0]]
Output: 1
Explanation: Only one path: down then right, avoiding the obstacle.
Example 2
Input: [[0,1,0],[0,0,0],[1,0,0]]
Output: 2
Explanation: Two paths exist avoiding obstacles.
Example 3
Input: [[0,0,1],[0,1,0],[0,0,0]]
Output: 1
Explanation: Only one path exists due to obstacles.
Constraints
Case 1
Input: [[0,0,0],[0,0,1],[0,0,0]]
Expected: 3
Case 2
Input: [[0,1],[1,0]]
Expected: 0
Case 3
Input: [[0,0,0,0],[0,1,1,0],[0,0,0,0]]
Expected: 4
Case 4
Input: [[1,0],[0,0]]
Expected: 0
Case 5
Input: [[0]]
Expected: 1