Leetcode 1450: Number of students doing homework at a given time

Pierre-Marie Poitevin
1 min readMay 25, 2020

In this Leetcode problem, w are given start and end working times for students, and should return how many students work at a given time queryTime.

Problem statement

Solution

For each student i, we know they work at queryTime if and only if:

startTime[i] <= queryTime <= endTime[i]

--

--