Medium
Quiz
#62 Unique Paths
APPROACH
A robot starts at the top-left cell of an m x n grid and can only move right or down toward the bottom-right cell. Given m and n, return the number of distinct paths. The answer will not exceed 2 * 109.
Example 1:
Input: m = 3, n = 7
Output: 28
Example 2:
Input: m = 3, n = 2
Output: 3
Explanation: From the top-left corner, there are a total of 3 ways to reach the bottom-right corner:
1. Right -> Down -> Down
2. Down -> Down -> Right
3. Down -> Right -> Down
1 of 4
1:00
What is the optimal approach for this problem?