Python DP beat 100% python submissions
Thanks to leetcode\'s new servers :)\n\n\ndp formule is very easy below:\n\n\n\n    def uniquePathsWithObstacles(self, obstacleGrid):\n        """\n        :typ
Thanks to leetcode\'s new servers :)\n\n\ndp formule is very easy below:\n![image](https://s3-lc-upload.s3.amazonaws.com/users/joezhow777/image_1530876896.png)\n\n```\n    def uniquePathsWithObstacles(self, obstacleGrid):\n        """\n        :type obstacleGrid: List[List[int]]\n        :rtype: int\n        """\n        dp = [[0]*len(obstacleGrid[0]) for _ in range(len(obstacleGrid))]\n        dp[0][0] = 1 if obstacleGrid[0][0] == 0 else 0\n\n        for i in range(len(obstacleGrid)):\n            for j in range(len(obstacleGrid[0])):\n                if obstacleGrid[i][j] == 1:\n                    dp[i][j] = 0\n                else:\n                    if i-1>=0:\n                        dp[i][j] += dp[i-1][j]\n                    if j-1>=0:\n                         dp[i][j] += dp[i][j-1]\n        return dp[-1][-1]\n```
[]