1450. Number of Students Doing Homework at a Given Time

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1450

class Solution:
    def busyStudent(
        self, startTime: List[int], endTime: List[int], queryTime: int
    ) -> int:
        c = [0] * 1010
        for a, b in zip(startTime, endTime):
            c[a] += 1
            c[b + 1] -= 1
        return sum(c[: queryTime + 1])