Algorithm · Google · Medium
You are given a list of busy intervals for several people. Each entry is a triplet [person_id, start_day, end_day] that marks a contiguous range of days (inclusive) when that person is occupied. Intervals belonging to the same person_id should be merged into a single set of busy days for that individual. Days are numbered starting from 1. Determine all days on which every person is free at the same time. Example 1: Input: intervals = [[1, 1, 2], [1, 4, 5]] Output: [3]…
Checking your access…