A robot is situated on an m
x n
grid, starting at the top-left corner (grid[0][0]
) with the goal of reaching the bottom-right corner (grid[m - 1][n - 1]
). In one step, the robot can only either move down or right by a single cell.
Given the integers m
and n
, determine the number of distinct paths the robot can take to reach the bottom-right corner.
m: number
: An integern: number
: An integerInput: m = 3, n = 2Output: 3Explanation: The robot has 3 unique paths to reach the target point in a 3x2 grid: Right-Down-Down, Down-Down-Right, Down-Right-Down.
Input: m = 5, n = 7Output: 210Explanation: The robot can navigate a 5x7 grid using 210 unique paths to reach the target point.
Input: m = 10, n = 4Output: 220Explanation: The robot can navigate a 10x4 grid using 220 unique paths to reach the target point.
m
, n
<= 100A robot is situated on an m
x n
grid, starting at the top-left corner (grid[0][0]
) with the goal of reaching the bottom-right corner (grid[m - 1][n - 1]
). In one step, the robot can only either move down or right by a single cell.
Given the integers m
and n
, determine the number of distinct paths the robot can take to reach the bottom-right corner.
m: number
: An integern: number
: An integerInput: m = 3, n = 2Output: 3Explanation: The robot has 3 unique paths to reach the target point in a 3x2 grid: Right-Down-Down, Down-Down-Right, Down-Right-Down.
Input: m = 5, n = 7Output: 210Explanation: The robot can navigate a 5x7 grid using 210 unique paths to reach the target point.
Input: m = 10, n = 4Output: 220Explanation: The robot can navigate a 10x4 grid using 220 unique paths to reach the target point.
m
, n
<= 100console.log()
statements will appear here.