77. Unique Paths

A robot starts at the top-left of an m × n grid and can only move right or down. How many different paths reach the bottom-right corner?

Example 1

Input: m = 3, n = 7
Output: 28

Example 2

Input: m = 3, n = 2
Output: 3
Hint 1

paths(r, c) = paths(r − 1, c) + paths(r, c − 1).

Hint 2

The first row and column each have exactly one path.

Dynamic ProgrammingMath