medium
Unique Paths
A robot starts at the top-left corner of an m × n grid and can move only right or down. Count the number of distinct paths to the bottom-right corner.
Constraints
- 1 ≤ m, n ≤ 100
- The answer fits in a 32-bit integer
Examples
in: m = 3, n = 7
out: 28
in: m = 3, n = 2
out: 3
Code it yourself
Solve in
Test execution is not yet available for this exercise.Practice journal →Draft saved in this browser.
Hints:
Which approach applies?
Choose an approach to check your pattern recognition, or reveal the discussion when you need help.