Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 495 Bytes

1450.md

File metadata and controls

19 lines (17 loc) · 495 Bytes

1450. Number of Students Doing Homework at a Given Time

Solution 1 (time O(n), space O(1))

class Solution(object):
    def busyStudent(self, startTime, endTime, queryTime):
        """
        :type startTime: List[int]
        :type endTime: List[int]
        :type queryTime: int
        :rtype: int
        """
        ans = 0
        for s, e in zip(startTime, endTime):
            if s <= queryTime <= e:
                ans += 1
        return ans