Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1656. Design an Ordered Stream
Maintain an array-backed stream of n (id, value) pairs arriving out of order and, on each insert, return the largest contiguous chunk of values starting from the next expected id so that all returned chunks concatenate to the values sorted by id. Essentially: support inserts that may fill gaps and advance a pointer to emit consecutive stored values in increasing id order.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.