Module Expr Str Assign NameStore Str ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num If BoolOpOr CompareEq SubscriptLoad SubscriptLoad NameLoad Index Num Index Num Num CompareEq SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index BinOpSub NameLoad Num Num body Return Num Assign NameStore ListComp ListComp Num comprehension NameStore Call NameLoad NameLoad comprehension NameStore Call NameLoad NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Num Index Num Num For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body If BoolOpAnd CompareEq NameLoad Num CompareEq NameLoad Num body Continue If CompareEq NameLoad Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad IfExp CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index BinOpSub NameLoad Num Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index BinOpSub NameLoad Num Num orelse If CompareEq NameLoad Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad IfExp CompareEq SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index NameLoad Num SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index NameLoad Num orelse If BoolOpAnd CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index BinOpSub NameLoad Num Num CompareEq SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index NameLoad Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad BinOpAdd SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index BinOpSub NameLoad Num orelse If CompareEq SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index BinOpSub NameLoad Num Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index BinOpSub NameLoad Num orelse If CompareEq SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index NameLoad Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index NameLoad orelse Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num Return SubscriptLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Index BinOpSub NameLoad Num decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore ListLoad ListLoad Num Num ListLoad Num Num ListLoad Num Num Assert CompareEq Call AttributeLoad Call NameLoad attr NameLoad Num
N/A N/A 
Follow up for "Unique Paths":

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

An obstacle and empty space is marked as 1 and 0 respectively in the grid.

For example,
There is one obstacle in the middle of a 3x3 grid as illustrated below.

[
  [0,0,0],
  [0,1,0],
  [0,0,0]
]
The total number of unique paths is 2.

Note: m and n will be at most 100.
 N/A __author__ Danyang Solution N/A N/A uniquePathsWithObstacles N/A N/A self obstacleGrid N/A N/A N/A 
        dp
        :param obstacleGrid:  a list of lists of integers
        :return: integer
         N/A m N/A len obstacleGrid N/A n N/A len N/A obstacleGrid N/A 0 N/A N/A N/A N/A N/A obstacleGrid N/A 0 N/A 0 1 N/A N/A N/A obstacleGrid N/A N/A m 1 N/A N/A n 1 1 N/A N/A 0 N/A path N/A N/A 0 N/A _ N/A range n N/A _ N/A range m N/A N/A N/A path N/A 0 N/A 0 1 N/A i N/A range m N/A N/A j N/A range n N/A N/A N/A N/A i 0 N/A j 0 N/A N/A N/A N/A i 0 N/A N/A N/A N/A path N/A i N/A j N/A N/A N/A N/A obstacleGrid N/A i N/A N/A j 1 0 N/A N/A path N/A i N/A N/A j 1 0 N/A N/A N/A j 0 N/A N/A N/A N/A path N/A i N/A j N/A N/A N/A N/A obstacleGrid N/A N/A i 1 N/A j 0 N/A N/A path N/A N/A i 1 N/A j 0 N/A N/A N/A N/A N/A N/A obstacleGrid N/A i N/A N/A j 1 0 N/A N/A N/A obstacleGrid N/A N/A i 1 N/A j 0 N/A N/A N/A N/A path N/A i N/A j N/A N/A N/A path N/A N/A i 1 N/A j N/A N/A path N/A i N/A N/A j 1 N/A N/A N/A N/A N/A obstacleGrid N/A i N/A N/A j 1 0 N/A N/A N/A N/A path N/A i N/A j N/A N/A path N/A i N/A N/A j 1 N/A N/A N/A N/A N/A obstacleGrid N/A N/A i 1 N/A j 0 N/A N/A N/A N/A path N/A i N/A j N/A N/A path N/A N/A i 1 N/A j N/A N/A N/A N/A path N/A i N/A j 0 N/A N/A N/A path N/A N/A m 1 N/A N/A n 1 N/A N/A N/A N/A __name__ __main__ N/A N/A grid N/A N/A 0 0 N/A 1 1 N/A 0 0 N/A N/A N/A N/A N/A Solution uniquePathsWithObstacles grid 0