Zigzag Iterator
Given k 1d vectors, implement an iterator to return their elements alternately.
The "Zigzag" order is not clearly defined and is ambiguous fork > 2
cases. If "Zigzag" does not look right to you, replace "Zigzag" with "Cyclic". For example:
Uses a linkedlist to store the iterators in different vectors. Every time we call next(), we pop an element from the list, and re-add it to the end to cycle through the lists.
Last updated