251. Flatten 2D Vector

    [LeetCode] 251. Flatten 2D Vector

    251. Flatten 2D Vector Medium 602338Add to ListShare Design an iterator to flatten a 2D vector. It should support the next and hasNext operations. Implement the Vector2D class: Vector2D(int[][] vec) initializes the object with the 2D vector vec. next() returns the next element from the 2D vector and moves the pointer one step forward. You may assume that all the calls to next are valid. hasNext(..