Your question is Intersecting Time Intervals. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given task1 and task2, both being lists of sublists where each sublist represents [start_time, end_time], return a list of sublists containing the common intersection time [start, end].
Asked in the Round 1 : DSA stage. Coding question asked during DSA round.
Implement common_intersections(task1, task2). Each input is a list of sorted, non-overlapping closed intervals [start_time, end_time]. Return every non-empty intersection in chronological order. If two intervals touch at one endpoint, include that point, such as [2, 2].
def common_intersections(task1, task2):