// 1450. Number of Students Doing Homework at a Given Time
class Solution {
public int busyStudent(int[] startTime, int[] endTime, int queryTime) {
int ans = 0;
for (int i = 0; i < startTime.length; ++i) {
if (startTime[i] <= queryTime && endTime[i] >= queryTime) {
++ans;
}
}
return ans;
}
}
学习笔记: 这是一道超级大水题,就一个for循环里面有个if就没了,三分钟写完。