Bottom up iterative solution, O(mn), no extra space
 public int uniquePathsWithObstacles(int[][] obstacleGrid) {\n        int m = obstacleGrid.length;\n        int n = obstacleGrid[0].length;\n        \n        f
     public int uniquePathsWithObstacles(int[][] obstacleGrid) {\n        int m = obstacleGrid.length;\n        int n = obstacleGrid[0].length;\n        \n        for (int r = m - 1; r >= 0; r--) {\n            for (int c = n - 1; c >= 0; c--) {\n                if (obstacleGrid[r][c] == 1) obstacleGrid[r][c] = 0;\n                else {\n                    if (r == m - 1 && c == n - 1) obstacleGrid[r][c] = 1;\n                    else if (r == m - 1) obstacleGrid[r][c] = obstacleGrid[r][c + 1];\n                    else if (c == n - 1) obstacleGrid[r][c] = obstacleGrid[r + 1][c];\n                    else obstacleGrid[r][c] = obstacleGrid[r][c + 1] + obstacleGrid[r + 1][c];\n                }\n            }\n        }\n        \n        return obstacleGrid[0][0];\n    }
['Java']