This question evaluates competency in interval processing, temporal data aggregation, and multi-stream synchronization, within the Coding & Algorithms domain, and requires practical application-level understanding of interval intersection and time-stamped sensor data handling.
You are now processing data from multiple security cameras.
You are given:
N
, the number of cameras.
T
(a real number).
i
(0-indexed), a vector (array) of time-stamped motion readings:
readings[i]
is an array of pairs
[time, motion_level]
for camera
i
.
time
.
For a single camera, define its active intervals as in the previous question:
motion_level > T
.
For this problem, we are interested in time intervals during which all cameras are simultaneously active.
Task:
Return a list of intervals [start_time, end_time] representing all such overlapping intervals where all N cameras are active at the same time.
Assumptions:
Follow-up discussion:
N
becomes very large (e.g., thousands or more), and each has many readings.