C++ Solution
Approach\n Describe your approach to solving the problem. \n    Recursive DP\n\n# Code\n\nclass Solution {\npublic:\n    int nl, ml, dp[105][105];\n    vector<v
# Approach\n<!-- Describe your approach to solving the problem. -->\n    Recursive DP\n\n# Code\n```\nclass Solution {\npublic:\n    int nl, ml, dp[105][105];\n    vector<vector<int>> obstacleGrids;\n\n    bool valid(int x, int y) {\n        if(x < nl && y < ml && obstacleGrids[x][y] == 0) return true;\n        else return false;\n    }\n\n    int solve(int i, int j) {\n        if(!valid(i, j)) return 0;\n        if(i == nl - 1 && j == ml - 1) return 1;\n        if(dp[i][j] != -1) return dp[i][j];\n        int ans = solve(i + 1, j) + solve(i, j + 1);\n        return dp[i][j] = ans;\n    }\n\n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        memset(dp, -1, sizeof(dp));\n        obstacleGrids = obstacleGrid;\n        nl = obstacleGrid.size(), ml = obstacleGrid[0].size();\n        int ans = solve(0, 0);\n        return ans;\n    }\n};\n```
['C++']