Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Unique Paths (medium)

Problem Statement

Given a 2-dimensional grid of size m x n (where m is the number of rows and n is the number of columns), you need to find out the number of unique paths from the top-left corner to the bottom-right corner. The constraints are that you can only move either right or down at any point in time.


  1. Example 1:
    • Input: 3, 3
    • Expected Output: 6
    • Justification: The six possible paths are:
      1. Right, Right, Down, Down
      2. Right, Down, Right, Down
      3. Right, Down, Down, Right 4




Like the course? Get enrolled and start learning!