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
<= 100Strict typing? Never heard of it. This black tee is a tribute to every dev who technically writes TypeScript but secretly lets any
handle the tough stuff. Clean, subtle, and dangerously relatable, it's the perfect uniform for those who believe type safety is just a suggestion.
Strict typing? Never heard of it. This black tee is a tribute to every dev who technically writes TypeScript but secretly lets any
handle the tough stuff. Clean, subtle, and dangerously relatable, it's the perfect uniform for those who believe type safety is just a suggestion.
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
<= 100Strict typing? Never heard of it. This black tee is a tribute to every dev who technically writes TypeScript but secretly lets any
handle the tough stuff. Clean, subtle, and dangerously relatable, it's the perfect uniform for those who believe type safety is just a suggestion.
console.log()
statements will appear here.