Design a class that receives a stream of non-negative integers and can summarize the values seen so far as a list of disjoint intervals. addNum(value) adds a value and getIntervals() returns the merged intervals sorted by start.
Practise this challenge
All coding challenges