C++ Easy Fast and Short DP solution
\nclass Solution {\npublic:\n    \n    int solve(int i, int j, vector<vector<int>> &dp, vector<vector<int>>& grid)\n    {\n        if(grid[i][j]==1) return 0;\n
```\nclass Solution {\npublic:\n    \n    int solve(int i, int j, vector<vector<int>> &dp, vector<vector<int>>& grid)\n    {\n        if(grid[i][j]==1) return 0;\n        \n        if(i==0 and j==0) return 1;\n        if(i==0) return dp[i][j-1];\n        if(j==0) return dp[i-1][j]; \n            \n        return dp[i-1][j] + dp[i][j-1];\n    }\n    \n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        int n = obstacleGrid.size(), m = obstacleGrid[0].size();\n        \n        if(obstacleGrid[n-1][m-1]==1) return 0;\n        \n        vector<vector<int>> dp(n, vector<int> (m,0));\n        \n        for(int i=0;i<n;i++)\n        for(int j=0;j<m;j++)\n        dp[i][j] = solve(i,j,dp, obstacleGrid);\n        \n        return dp[n-1][m-1];\n    }\n};\n```
['Dynamic Programming', 'C']