LeetCode 281: Zigzag Iterator
Problem Restatement We are given two integer lists, v1 and v2 . We need to implement an iterator that returns their elements alternately. For example: v1 = [1, 2] v2 = [3, 4, 5, 6] The iterator should return: 1, 3, 2, 4, 5, 6 Once one list runs out, we continue returning elements from the other list. The class has three operations: ZigzagIterator(v1, v2) next() hasNext() The source statement...