Accepted simple Python in-place solution
As below. Any comments on how to make it shorter? Thx!\n\n    class Solution:\n        # @param obstacleGrid, a list of lists of integers\n        # @return an 
As below. Any comments on how to make it shorter? Thx!\n\n    class Solution:\n        # @param obstacleGrid, a list of lists of integers\n        # @return an integer\n        def uniquePathsWithObstacles(self, obstacleGrid):\n            m = len(obstacleGrid)\n            n = len(obstacleGrid[0])\n            obstacleGrid[0][0] = 1 - obstacleGrid[0][0]\n            \n            for i in range(1, n):\n                if not obstacleGrid[0][i]:\n                    obstacleGrid[0][i] = obstacleGrid[0][i-1]\n                else:\n                    obstacleGrid[0][i] = 0\n                    \n            for i in range(1, m):\n                if not obstacleGrid[i][0]:\n                    obstacleGrid[i][0] = obstacleGrid[i-1][0]\n                else:\n                    obstacleGrid[i][0] = 0\n                    \n            for i in range(1, m):\n                for j in range(1, n):\n                    if not obstacleGrid[i][j]:\n                        obstacleGrid[i][j] = obstacleGrid[i][j-1]+obstacleGrid[i-1][j]\n                    else:\n                        obstacleGrid[i][j] = 0\n                        \n            return obstacleGrid[-1][-1]
[]