Available question text
Maintain a dynamic set of disjoint, sorted intervals that summarize all integers seen from a stream, merging intervals when a new value is adjacent to or overlaps existing ones. The challenge is to support many addNum operations and occasional getIntervals efficiently, especially when frequent merges keep the number of intervals small relative to the stream size.
Related questions
Continue with questions that share topics or the same question type.
- Find Consecutive Integers from a Data Stream
Coding
- Find Median from Data Stream
Coding · Data Stream · Design · Heap (Priority Queue)
- Moving Average from Data Stream
Coding · Array · Data Stream · Design
- Partition Array into Disjoint Intervals
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Meta
Leetcode 352. Data Stream as Disjoint Intervals
Reported Oct 21, 2024 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source