Here's my code:

```
def uniquePathsWithObstacles(self, obstacleGrid):
if not obstacleGrid: return 0
m,n = len(obstacleGrid),len(obstacleGrid[0])
mat = [[0]*(n+1)]*(m+1)
mat[m-1][n] = 1
for i in reversed(range(m)):
for j in reversed(range(n)):
mat[i][j] = 0 if obstacleGrid[i][j] == 1 else mat[i][j+1]+mat[i+1][j]
return mat[0][0]
```

When input is [[0],[0]] the output is 2, which should be 1 as correct answer.

I can't find out why and how to fix it. Thanks if anyone can help me fix this problem!