A robot starts at the top-left cell of an m x n grid. Its goal is to reach the bottom-right cell of the grid.
At every step, it may only move one cell to the right or one cell down.
Your task is to determine the total number of unique paths that lead the robot from its starting point to its destination.
You may assume that both m and n are positive integers.
The result will always be less than or equal to 2 × 10⁹.
Input: m = 2, n = 3
Output: 3
Explanation:
Possible paths: 1. Right → Right → Down 2. Right → Down → Right 3. Down → Right → Right
Input: m = 4, n = 4
Output: 20
Explanation:
There are 20 different ways for the robot to reach the bottom-right cell in a 4x4 grid.
Accepted:
Submission: