C++ | Straight forward dp solution
\nclass Solution {\n    \n    int row;\n    int col;\n    \npublic:\n    int dfs(vector<vector<int>>& grid, int i, int j, vector<vector<int>>& dp){\n        \n 
```\nclass Solution {\n    \n    int row;\n    int col;\n    \npublic:\n    int dfs(vector<vector<int>>& grid, int i, int j, vector<vector<int>>& dp){\n        \n        //base cases\n        if(i < 0 || j < 0\n          || i >= row\n          || j >= col)\n            return 0;\n        \n        if(grid[i][j]){\n            dp[i][j] = 0;\n            return dp[i][j];\n        }\n        \n        if(i == row - 1 && j == col - 1)\n            return 1;\n        \n        if(dp[i][j])\n            return dp[i][j];\n        \n        dp[i][j] = dfs(grid, i + 1, j, dp) + dfs(grid, i, j + 1, dp);\n        \n        return dp[i][j];\n    }\n    \n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        \n        row = obstacleGrid.size();\n        col = obstacleGrid[0].size();\n        \n        vector<vector<int>> dp(row, vector<int>(col, 0));\n        \n        return dfs(obstacleGrid, 0, 0, dp);\n    }\n};\n```
['Dynamic Programming', 'C', 'C++']