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):