C++ Dp solution (Almost same code as Unique paths i)
\nclass Solution {\npublic:\n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        int m=obstacleGrid.size();\n        int n=obstacleGr
```\nclass Solution {\npublic:\n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        int m=obstacleGrid.size();\n        int n=obstacleGrid[0].size();\n        if(m==0||n==0) return 0;\n        int dp[m][n];\n         memset(dp,0,sizeof(dp));\n        for(int i=0;i<m;i++)\n        {   if(obstacleGrid[i][0]!=1) dp[i][0]=1;\n            else break;\n        }\n        for(int j=0;j<n;j++)\n        {   if(obstacleGrid[0][j]!=1) dp[0][j]=1;\n            else break;\n        }\n        for(int i=1;i<m;i++)\n            for(int j=1;j<n;j++)\n                if(obstacleGrid[i][j]!=1)\n                    dp[i][j]=dp[i-1][j]+dp[i][j-1];\n        return dp[m-1][n-1];\n    }\n};\n```\n
['Dynamic Programming', 'C', 'C++']