Unique Paths in Grid

00:00
MediumDynamic ProgrammingMathCombinatorics
AmazonGoogle

Count distinct paths from top-left to bottom-right of m×n grid. Can only move right or down.

Examples

Input → m=3, n=7
Output → 28
Input → m=3, n=2
Output → 3
Input → m=1, n=1
Output → 1