My C++ Dp solution , very simple!
just use dp to find the answer , if there is a obstacle at (i,j), then dp[i][j] = 0. \ntime is O(nm) , space is O(nm) . \nhere is my code:\n\n    class Solution
just use dp to find the answer , if there is a obstacle at (i,j), then dp[i][j] = 0. \ntime is O(n*m) , space is O(n*m) . \nhere is my code:\n\n    class Solution {\n    public:\n        int uniquePathsWithObstacles(vector<vector<int> > &obstacleGrid) {\n            int m = obstacleGrid.size() , n = obstacleGrid[0].size();\n            vector<vector<int>> dp(m+1,vector<int>(n+1,0));\n            dp[0][1] = 1;\n            for(int i = 1 ; i <= m ; ++i)\n                for(int j = 1 ; j <= n ; ++j)\n                    if(!obstacleGrid[i-1][j-1])\n                        dp[i][j] = dp[i-1][j]+dp[i][j-1];\n            return dp[m][n];\n        }\n    };
[]