Grid Unique Paths

Given m rows and n columns, return the number of paths from the top-left cell to the bottom-right cell. Each move goes exactly one cell right or one cell…

Given m rows and n columns, return the number of paths from the top-left cell to the bottom-right cell. Each move goes exactly one cell right or one cell down. Count paths, not their length; return only the count.

- 1 <= m, n <= 100. - The number of paths is guaranteed to be at most 1,000,000,000; both conditions define valid inputs. - Visualizer presets use dimensions at most 8 by 8; longer valid inputs are coding-only.

Example 1: input m = 3, n = 2; output 3. Place the single right move before, between, or after the two down moves.

Example 2: input m = 2, n = 4; output 4. The single down move can occupy any of four positions.

Category: Arrays. Topic: dynamic-programming. Difficulty: medium. Patterns: dynamic-programming, dynamic-programming-2d.