Short JAVA solution
public int uniquePathsWithObstacles(int[][] obstacleGrid) {\n        int width = obstacleGrid[0].length;\n        int[] dp = new int[width];\n        dp[0] = 1;
    public int uniquePathsWithObstacles(int[][] obstacleGrid) {\n        int width = obstacleGrid[0].length;\n        int[] dp = new int[width];\n        dp[0] = 1;\n        for (int[] row : obstacleGrid) {\n            for (int j = 0; j < width; j++) {\n                if (row[j] == 1)\n                    dp[j] = 0;\n                else if (j > 0)\n                    dp[j] += dp[j - 1];\n            }\n        }\n        return dp[width - 1];\n    }
[]