C++ Super Simple and Clean Dynamic-Programming Iterative Solution
\nclass Solution {\npublic:\n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        if (obstacleGrid[0][0] == 1) \n            return 0;
```\nclass Solution {\npublic:\n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {\n        if (obstacleGrid[0][0] == 1) \n            return 0;\n        \n        obstacleGrid[0][0] = 1;\n        \n        int n = obstacleGrid.size(), m = obstacleGrid[0].size();\n        \n        for (int i = 1; i < n; i++)\n            obstacleGrid[i][0] = (obstacleGrid[i][0] == 0 && obstacleGrid[i-1][0] == 1) ? 1 : 0;\n\n        for (int i = 1; i < m; i++)\n            obstacleGrid[0][i] = (obstacleGrid[0][i] == 0 && obstacleGrid[0][i-1] == 1) ? 1 : 0;\n\n        for (int i = 1; i < n; i++)\n            for (int j = 1; j < m; j++)\n                obstacleGrid[i][j] = obstacleGrid[i][j] == 1 ? 0 : obstacleGrid[i-1][j] + obstacleGrid[i][j-1];\n        \n        return obstacleGrid[n-1][m-1];\n    }\n};\n```\n**Like it? please upvote!**
['Dynamic Programming', 'C', 'Iterator']