63. Unique Paths II 100% faster || very easy to understand ||
\n### The idea is same as Unique Paths but with checking obstacles...\n1. First we have to make an 2d array .\n2. then filling the 1st row boundry blocks with c
\n### The idea is same as Unique Paths but with checking obstacles...\n1. First we have to **make an 2d array** .\n2. then filling the **1st row boundry blocks with checking obstacles** if found then **whole row is 0** ;because there is noy way to reach at that position.\n3. simlarly for **1st column boundry side blocks** .\n4. and last filling all the middle elements same checking **obstacles** if **found put 0**\n \nThis is the idea if you helpful then please **!!upvote!!**\n```\nclass Solution {\npublic:\n    int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) \n    {\n        int m=obstacleGrid.size();\n        int n=obstacleGrid[0].size();\n        int arr[m][n];\n        for(int i=0;i<m;i++)\n        {\n            if(obstacleGrid[i][0]==1)\n                {\n                    arr[i][0]=0;\n                    for(int j=i+1;j<m;j++)\n                    {\n                        arr[j][0]=0;\n                    }\n                break;\n                }\n            else\n            {\n                    arr[i][0]=1;\n            }\n        }\n         for(int i=0;i<n;i++)\n        {\n            if(obstacleGrid[0][i]==1)\n                {\n                    arr[0][i]=0;\n                 for(int j=i+1;j<n;j++)\n                    {\n                        arr[0][j]=0;\n                    }\n                    break;\n                }\n            else\n            {\n                    arr[0][i]=1;\n            }\n        }\n         for(int i=1;i<m;i++)\n        {\n            for(int j=1;j<n;j++)\n            {\n                if(obstacleGrid[i][j]==1)\n                {\n                    arr[i][j]=0;\n                }\n                \n                else\n                {\n                    arr[i][j]=arr[i-1][j]+arr[i][j-1];\n                }  \n            }\n        }\n        return arr[m-1][n-1];\n    }\n};\n```\n//------------//---------//----------//-------------//-------------//----------//---------//-------------//----\n```\nif ( if you understand )\n     {\n          Upvote (this post);\n     }\nelse if (just want to know solution)\n     {\n    ignore(post);\n     }\nelse\n    {\n  UPVOTE\n   }\n   ```\n  !! Thanks !!\n\n
['Dynamic Programming', 'C++']