Tap here to switch tabs
Problem
Submissions

Problem: Number of Students Doing Homework at a Given Time

Number of Students Doing Homework at a Given Time counts students whose homework is in progress at a specified time, based on their inclusive start and completion times.

Statement

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

The ithi^{ {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

Number of Students Doing Homework at a Given Time counts students whose homework is in progress at a specified time, based on their inclusive start and completion times.

Statement

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

The ithi^{ {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