Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 251. Flatten 2D Vector
Implement an iterator over a 2D vector that yields integers in row-major order via next() and hasNext(). The core challenge is maintaining indices and skipping empty inner lists efficiently so iteration remains correct and amortized O(1) per operation.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid February, 2025
Meta
Mid-level
Late November, 2024
Mid-level
Implement a 2D vector iterator (similar to LeetCode's Flatten 2D Vector problem)
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.