Loading...
Loading...
Loading...
A delivery robot moves from the top-left to the bottom-right cell of a grid, one step right or down. Cells marked # are blocked. Count the routes with a cached recursion.
. (free) and # (blocked) characters.Example
Input
3 3 ... .#. ...
Output
2
Two routes go around the block.
Try the problem first. Open one hint at a time.
The routes to a cell are the routes to the cell above plus those to the cell on the left.
A blocked or outside cell has 0 routes.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor