Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    Practice problems / Meeting rooms needed

    Meeting rooms needed

    Mediumintervalssortingheapgreedy

    Each [start, end] is a meeting. Return the fewest rooms that fit them all. A meeting ending at 10 and another starting at 10 can share a room.

    Example 1

    Input:  intervals = [[0,30],[5,10],[15,20]]
    Output: 2

    Example 2

    Input:  intervals = [[7,10],[2,4]]
    Output: 1

    Constraints

    • 1 ≤ intervals.length ≤ 10⁴
    • 0 ≤ start < end ≤ 10⁶

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

    /**
     * @param {int[][]} intervals
     * @return {int}
     */
    function minMeetingRooms(intervals) {
      
    }
    
    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.