LeetCode --- 1450. Number of Students Doing Homework at a Given Time 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1450. Number of Students Doing Homework at a Given Time 解题报告相关的知识,希望对你有一定的参考价值。

Given two integer arrays startTime and endTime and given an integer queryTime.

The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i].

Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTime lays in the interval [startTime[i], endTime[i]] inclusive.

Example 1:

Input: startTime = [1,2,3], endTime = [3,2,7], queryTime = 4
Output: 1
Explanation: We have 3 students where:
The first student started doing homework at time 1 and finished at time 3 and wasn\'t doing anything at time 4.
The second student started doing homework at time 2 and finished at time 2 and also wasn\'t doing anything at time 4.
The third studen

以上是关于LeetCode --- 1450. Number of Students Doing Homework at a Given Time 解题报告的主要内容,如果未能解决你的问题,请参考以下文章