Limited time: AI code review, hints, mock interviews, whiteboard analysis, and all Pro features are unlocked. Enroll

Unique Paths

Medium

Topics
MathDynamic ProgrammingCombinatorics

A robot sits at the top-left of an m x n grid and can only move right or down. Return the number of distinct paths to the bottom-right corner.

Example 1

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

Example 2

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

Constraints

  • 1 <= m, n <= 100
Run ⌘' · Submit ⌘⏎
SensAI SensAI
Beta
Listening...
Tap mic to stop voice mode

Unlock AI Features

One click to activate - no payment, no credit card. Just sign in and you're in.

AI code review and hints
SensAI chat assistant
AI mock interviews
Whiteboard analysis
100% free during early access