Java Simple and clean DP solution,  easy to understand.
\n\tpublic int uniquePathsWithObstacles(int[][] obstacleGrid) {\n\t\tint m = obstacleGrid.length, n = obstacleGrid[0].length;\n\t\tint[][] path = new int[m][n];
   \n\tpublic int uniquePathsWithObstacles(int[][] obstacleGrid) {\n\t\tint m = obstacleGrid.length, n = obstacleGrid[0].length;\n\t\tint[][] path = new int[m][n];\n\t\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tif (obstacleGrid[i][0] == 1)  {\n\t\t\t\tpath[i][0] = 0;\n\t\t\t\t//on the first column, if there is an obstacle, the rest are blocked. \n\t\t\t\t//no need to continue.\n\t\t\t\tbreak;  \n\t\t\t} else\n\t\t\t\tpath[i][0] = 1;\n\t\t}\n\t\t\n\t\tfor (int j = 0; j < n; j++) {\n\t\t\tif (obstacleGrid[0][j] == 1)  {\n\t\t\t\tpath[0][j] = 0;\n\t\t\t\t//First row, once obstacle found, the rest are blocked.\n\t\t\t\tbreak; \n\t\t\t} else\n\t\t\t\tpath[0][j] = 1;\n\t\t}\n\t\t\n\t\tfor (int i = 1; i < m; i++) {\n\t\t\tfor (int j = 1; j < n; j++) {\n\t\t\t\tif (obstacleGrid[i][j] == 1) \n\t\t\t\t\tpath[i][j] = 0;\n\t\t\t\telse\n\t\t\t\t\tpath[i][j] = path[i-1][j] + path[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn path[m-1][n-1];\n\t}
['Java']