1560. Number of Students Doing Homework at a Given Time
My accepted Python solution to LeetCode problem 1560, Number of Students Doing Homework at a Given Time, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.3MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.3MB, accepted 2025-12-29.
class Solution:
def busyStudent(self, startTime: List[int], endTime: List[int], queryTime: int) -> int:
return sum(1 for s, e in zip(startTime, endTime) if s <= queryTime <= e)