Unique Paths
Count paths from the top-left to the bottom-right of an m by n grid, moving only right or down.
Example 1
m = 3
n = 410Explanation
Two down and three right moves can be ordered in ten ways.
Example 2
m = 1
n = 71Explanation
One row forces every move right, giving one path.
Example 3
m = 2
n = 22Explanation
Right/down and down/right are the two possible paths.
Constraints
- 1 <= m,n <= 100
- The answer fits a signed 32-bit integer
Function contract
uniquePathsArguments: json, jsonSolutionRuns on your device
Loading draft…
Run: 3 examples; Submit: 33 cases, on your device.
34