Tap here to switch tabs
Problem
Submissions

Problem: Number of Students Doing Homework at a Given Time

med
30 min
Try to solve the Number of Students Doing Homework at a Given Time problem.

Statement

Given two integer arrays startTime and endTime along with an integer queryTime.

The iextthi^{ ext{th}} student started their homework at time startTime[i] and completed it at time endTime[i].

Return the number of students who were doing their homework at the time queryTime. More formally, return the count of students where startTime[i] ≤\leq queryTime ≤\leq endTime[i].

Constraints:

  • startTime.length ==== endTime.length

  • 1≤1 \leq startTime.length ≤100\leq 100

  • 1≤1 \leq startTime[i] ≤\leq endTime[i] ≤1000\leq 1000

  • 1≤1 \leq queryTime ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Students Doing Homework at a Given Time

med
30 min
Try to solve the Number of Students Doing Homework at a Given Time problem.

Statement

Given two integer arrays startTime and endTime along with an integer queryTime.

The iextthi^{ ext{th}} student started their homework at time startTime[i] and completed it at time endTime[i].

Return the number of students who were doing their homework at the time queryTime. More formally, return the count of students where startTime[i] ≤\leq queryTime ≤\leq endTime[i].

Constraints:

  • startTime.length ==== endTime.length

  • 1≤1 \leq startTime.length ≤100\leq 100

  • 1≤1 \leq startTime[i] ≤\leq endTime[i] ≤1000\leq 1000

  • 1≤1 \leq queryTime ≤1000\leq 1000