✅🚶‍♂️ Unique Paths II - Dynamic Programming Solution Video in Hindi 🛤️✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n\uD83D\uDD14 Don\u2019t Miss Out! If you\u2019re enjoying these step-by-step coding e
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n\uD83D\uDD14 Don\u2019t Miss Out! If you\u2019re enjoying these step-by-step coding explanations in Hindi, make sure to Subscribe to [Lucidd8](https://www.youtube.com/channel/UCPHfw-CeDZi-PwVSh1bU5jw?sub_confirmation=1) for more LeetCode solutions and C++ tutorials! \uD83D\uDE80\n\nhttps://youtu.be/QtOyNiRe0A4\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int uniquePathsMemo(int i, int j, vector<vector<int>>& grid, vector<vector<int>>& dp) {\n    if (i < 0 || j < 0 || grid[i][j] == 1) {\n        return 0;\n    }\n    if (i == 0 && j == 0) {\n        return 1;\n    }\n    if (dp[i][j] != -1) {\n        return dp[i][j];\n    }\n    return dp[i][j] = uniquePathsMemo(i - 1, j, grid, dp) + uniquePathsMemo(i, j - 1, grid, dp);\n}\n\nint uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n    int m = obstacleGrid.size();\n    int n = obstacleGrid[0].size();\n    vector<vector<int>> dp(m, vector<int>(n, -1));  \n    return uniquePathsMemo(m - 1, n - 1, obstacleGrid, dp);\n}\n};\n```
['C++']