InferenceAI

Enter at least two characters to search.

Start free

Most Meetings in One Room

easyGreedy & Intervals15 min10 XP

Meeting i runs from start[i] to end[i]. A meeting may begin strictly after the previous one ends. Return the maximum number of meetings one room can host.

Examples

EXAMPLE WALKTHROUGHfour meetings

A guided view of the published example, not a trace of your code.

INPUT[[1,3,0,5,8,5],[2,4,6,7,9,9]]
TASKmost_meetings_one_room()
EXPECTED OUTPUT4

Start with the input values shown in this example.

Example 1 of 3

Input: start = [1,3,0,5,8,5], end = [2,4,6,7,9,9]

Output: 4

Explanation: four meetings

Input: start = [10,12,20], end = [20,25,30]

Output: 1

Explanation: one meeting

Input: start = [1], end = [2]

Output: 1

Explanation: single

Hint 1

Always choose the meeting that ends earliest among those that can still fit.

Topics

DSAGreedy & IntervalsPython