2025-07-25 09:37:39 +0000 UTC

Number of Students Doing Homework at a Given Time

Code

class Solution:
    def busyStudent(self, startTime: List[int], endTime: List[int], queryTime: int) -> int:
        count = 0
        for start, end in zip(startTime, endTime):
            if queryTime >= start and queryTime <= end:
                count += 1
        return count