Simple Python Recursion Solution
\nclass Solution:\n    def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:\n        \n        def rec(grid, i, j, d):\n            if i > 
```\nclass Solution:\n    def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:\n        \n        def rec(grid, i, j, d):\n            if i > len(grid)-1 or j > len(grid[0])-1:\n                return 0\n            if grid[i][j] == 1:\n                return 0\n            if i == len(grid)-1 and j == len(grid[0])-1:\n                return 1\n            if (i,j) in d:\n                return d[(i,j)]\n            \n            down = rec(grid, i+1, j, d)\n            right = rec(grid, i, j+1, d)\n            \n            d[(i,j)] = down + right\n            return d[(i,j)]\n            \n        return rec(obstacleGrid, 0, 0, {})\n```\n\nfirst we check for base cases which are:\n1. out of bounds\n2. obstacle \n3. win \n4. already calculated it \n\nthen do recursion on down and right, add them up and get the result :)
['Recursion', 'Memoization', 'Python']