(This question is a variation of the LeetCode question 251. Flatten 2D Vector. If you haven't completed that question yet, it is recommended to solve it first.)
Design an iterator to flatten a 2D vector so that all its integers can be accessed sequentially, row by row. In addition to standard iteration, the iterator must support removing the last returned element and provide access to the snapshot of the current vector state after any number of removals.
Implement the Vector2D class:
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected