package leetcode;

/**
 * https://leetcode.com/problems/unique-paths-ii/
 */
public class Problem63 {
    public int uniquePathsWithObstacles(int[][] obstacleGrid) {
        // TODO: implement this
        return 0;
    }
    
    public static void main(String[] args) {
        Problem63 prob = new Problem63();
        int[][] grid = new int[][]{
            new int[]{0, 0, 0},
            new int[]{0, 1, 0},
            new int[]{0, 0, 0}
        };
        System.out.println(prob.uniquePathsWithObstacles(grid));
    }
}

@@ -171,48 +171,648 @@
     
-// TODO: implement this%0A        return 0
+if (obstacleGrid.length == 0) %7B%0A            return 0;%0A        %7D%0A        return findPaths(obstacleGrid, obstacleGrid.length-1, obstacleGrid%5B0%5D.length-1,%0A            0, 0);%0A    %7D%0A    %0A    private int findPaths(int%5B%5D%5B%5D grid, int destRow, int destCol, int row, int col) %7B%0A        if (row == destRow && col == destCol) %7B%0A            return 1;%0A        %7D %0A        if (row %3E destRow %7C%7C col %3E destCol) %7B%0A            return 0;%0A        %7D%0A        if (grid%5Brow%5D%5Bcol%5D == 1) %7B%0A            return 0;%0A        %7D%0A        int a = findPaths(grid, destRow, destCol, row+1, col);%0A        int b = findPaths(grid, destRow, destCol, row, col+1);%0A        return a + b
 ;%0A  
@@ -1003,24 +1003,24 @@
 %5D%7B0, 1, 0%7D,%0A
-
             
@@ -1037,16 +1037,81 @@
 0, 0, 0%7D
+,%0A            new int%5B%5D%7B0, 0, 0%7D,%0A            new int%5B%5D%7B0, 0, 0%7D,
 %0A       

Update problem 63 (too slow)