Solution for LeetCode: Unique Path II, Depth-first-search algorithm with memorization.

Solution: DFS with memorization

Note: we can only move with the direction of right or down. y), the way to (x, y) = (x-1, y) + (x, y-1), under the condition of [x-1, y] or [x, y-1] is not obstacle grid.

So we could use a DFS to calculate the number of paths, memorization will reduce much of duplicated computation.