Problem
A robot stands in the top-left cell of a grid with m rows and n columns. The robot must reach the bottom-right cell.
In each move, the robot goes one cell down or one cell right. Return the number of different paths from the top-left cell to the bottom-right cell.
Example 1
- Input:
- m = 3, n = 3
- Output:
- 6
- Explanation:
- Each path has 2 moves down and 2 moves right. These 4 moves can come in 6 different orders.
Example 2
- Input:
- m = 1, n = 5
- Output:
- 1
- Explanation:
- The grid has one row, so the robot can only move right.
Example 3
- Input:
- m = 4, n = 5
- Output:
- 35
Constraints
- 1 <= m, n <= 100
- The answer is at most 2 * 10^9.
SysRound wrote this statement. A reference solution checks every example.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 4 records
Amazon
Leetcode 62. Unique Paths
Reported Jan 11, 2025 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View sourceMeta
Leetcode 62. Unique Paths
Reported Mar 11, 2026 · 4 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View sourceMicrosoft
Leetcode 62. Unique Paths
Reported Nov 8, 2025 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View sourceOracle
Leetcode 62. Unique Paths
Reported Nov 30, 2025 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source