Search⌘ K
AI Features

Data Stream as Disjoint Intervals

Data Stream as Disjoint Intervals tracks non-negative integers as they arrive. Add values to the stream and return sorted, disjoint ranges that merge consecutive numbers and ignore duplicates.

Statement

You are given a stream of non-negative integers ...