Loading...
Loading...
Loading...
A courier starts in the top-left cell of a grid with r rows and c columns and must reach the bottom-right cell. She moves only one cell right or one cell down. Count the different routes.
Example
Input
2 3
Output
3
Three routes: RRD, RDR, DRR.
Try the problem first. Open one hint at a time.
At a cell, you can go right if there is a column left and down if there is a row left.
Return 1 when you stand on the goal cell, and add up what the two moves return.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor