Daily challenge for 2026-11-04
673. Timeline Capacity Tracker
You are given a list of reservations, where each reservation is represented as [start, end, load]. This indicates that an integer capacity load is consumed during the half-open time interval [start, end) (i.e., starting at time start and ending strictly before time end).
You are also given an array of integer time points queries, which is sorted in non-decreasing order.
Return an array of integers representing the total active load at each query time in queries.
Constraints:
There are 0–1,000 reservations and 0–1,000 query times. Each reservation uses a half-open [start,end) range with start < end and a non-negative integer load at most 1,000,000. Endpoints and query times are integers with absolute value at most 1,000,000. Query times are sorted in non-decreasing order; repeated times are allowed.
Example:
Input: reservations = [[1, 5, 10], [2, 4, 5], [6, 8, 7]], queries = [1, 3, 4, 5, 7]
Output: [10, 15, 10, 0, 7]