image_2021-10-18_15-20-14.png
32.8 KB
#N1450. Number of Students Doing Homework at a Given Time
problem link=>https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time/
#solution
problem link=>https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time/
#solution
class Solution {
public int busyStudent(int[] startTime, int[] endTime, int queryTime) {
int count=0;
for(int i=0; i<startTime.length; i++){
if(startTime[i]<=queryTime&&endTime[i]>=queryTime)
count++;
}
return count;
}
}