FunctionRacerProblemsRace

Unique Grid Paths

MediumDynamic programmingPython, JavaScript, TypeScript, Java, C++

A robot stands in the top left cell of a grid with m rows and n columns. It may only step one cell right or one cell down. Return the number of different paths to the bottom right cell.

Example 1

m 3
n 3
returns 6

6 paths.

Example 2

m 1
n 5
returns 1

Only one straight path.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Dynamic programming problems