Unique Paths
Problem statement
A robot starts in the top-left cell of a rows x columns grid and may move only one cell right or one cell down. Return the number of distinct paths to the bottom-right cell.
Function
uniquePaths(rows: int, columns: int) → intExamples
Example 1
rows = 3columns = 7return = 28Every path uses two down moves and six right moves.
Example 2
rows = 1columns = 5return = 1A one-row grid has only the all-right path.
Constraints
1 <= rows, columns <= 20.- The answer fits in a signed 32-bit integer.