Object-Oriented Programming · Airbnb · Medium
Requirements Accept several byte or character streams/iterators, with each one supporting sequential reads. Build a single iterator that alternates among them: take one item from stream 0, then stream 1, and so on before cycling back to stream 0. Once any stream has no remaining items, leave it out of all later cycles. Provide has_next() and next(). Preparation Be able to code a round-robin merge for a list of iterators, removing exhausted sources as needed, in less than 20…
Checking your access…