Solving Unique Paths II in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).

Now consider if some obstacles are added to the grids. How many unique paths would there be?

Example 1:

Output: 2
There is one obstacle in the middle of the 3x3 grid above.
There are two ways to reach the bottom-right corner:
1. Right -> Right -> Down -> Down
2. Down -> Down -> Right -> Right

See the full details of the problem Unique Paths II at LeetCode

Originally posted at: