Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Paths through a grid

    Paths through a grid

    Mediumdynamic programmingmathcombinatorics

    A robot starts at the top-left of an m × n grid and moves only right or down. Return the number of distinct paths to the bottom-right cell.

    Example 1

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

    Example 2

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

    Constraints

    • 1 ≤ m, n ≤ 15

    Submit checks your solution against 8 tests, including hidden ones.

    /**
     * @param {int} m
     * @param {int} n
     * @return {int}
     */
    function uniquePaths(m, n) {
      
    }
    
    Sign in to run
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.