Collapse per-user access windows into the smallest set of non-overlapping ranges. Ranges that touch at the boundary merge.
user_id, then start_epochranges[[1, 0, 10], [1, 10, 20], [1, 40, 50], [2, 5, 7]]
[[1, 0, 20], [1, 40, 50], [2, 5, 7]]
ranges[[1, 40, 50], [1, 0, 10], [1, 5, 20]]
[[1, 0, 20], [1, 40, 50]]
Community-reported interview topic. Not an official company question and no affiliation is implied.
Run against the public tests, or submit to score against all of them.