Given k lists of integers, possibly of different lengths, return their values by taking one from each list in turn: first the first value of every list, then the second value of every list that has one, and so on.
new ZigzagIterator(lists) - lists is an array of arrays; some may be emptyhasNext() - whether any value remainsnext() - the next value. Throw an Error when there is none- For
[[1, 2, 3], [4, 5, 6, 7], [8, 9]] the order is 1, 4, 8, 2, 5, 9, 3, 6, 7 - Do not copy all the values in the constructor, and do not change the input lists. Each call should be O(1)