NeetCode #842LC-1942MediumIntervals
← Back to All Problems

#842 · #1942 · The Number of the Smallest Unoccupied Chair(最小未被占据椅子的编号)

📌 Problem Statement & Constraints

There are infinitely many chairs numbered 0, 1, 2, .... Friends arrive at times[i][0] and leave at times[i][1], and each sits on the smallest-numbered free chair. Return the chair that targetFriend sits on. All arrival times are distinct. Constraints: 1 <= times.length <= 10^4, 0 <= times[i][0] < times[i][1] <= 10^5, 0 <= targetFriend < times.length.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!