A robot starts at the top-left corner of an m × n grid and wants to reach the bottom-right corner. It can only move right or down.
How many unique paths exist?
With m = 3, n = 7:
- Grid is 3 rows × 7 columns.
- Robot needs 2 down moves and 6 right moves in some order.
- Answer: .
With m = 3, n = 2:
- RRD, RDR, DRR... wait, that's wrong. Actually RD, DR (only 1 right, 2 downs? No.)
- means 3 rows (2 down moves), means 2 columns (1 right move).
- Paths: DR, RD, DR... = paths.
Constraints: .