Skip to content

Commit 1b47d3d

Browse files
committed
Create 1450-num_of_students_doing_hmk.py
1 parent 0dc3c66 commit 1b47d3d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

1450-num_of_students_doing_hmk.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time/submissions/
3+
4+
Runtime: 24 ms, faster than 81.31% of Python online submissions for Number of Students Doing Homework at a Given Time.
5+
Memory Usage: 12.7 MB, less than 62.91% of Python online submissions for Number of Students Doing Homework at a Given Time.
6+
"""
7+
class Solution(object):
8+
def busyStudent(self, startTime, endTime, queryTime):
9+
"""
10+
:type startTime: List[int]
11+
:type endTime: List[int]
12+
:type queryTime: int
13+
:rtype: int
14+
"""
15+
result = 0
16+
for start, end in zip(startTime, endTime):
17+
print(start, end)
18+
if start <= queryTime <= end:
19+
result += 1
20+
21+
return result

0 commit comments

Comments
 (0)