Search
⌘K

Leetcode 341. Flatten Nested List Iterator

Given a nested list where elements may be integers or sublists, implement a NestedIterator with next() and hasNext() that returns all integers in depth‑first, left‑to‑right order, flattening the structure lazily as you iterate.

Asked at:

LinkedIn

LinkedIn


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid December, 2025

LinkedIn

LinkedIn

Junior

Mid April, 2025

LinkedIn

LinkedIn

Staff

Early April, 2025

LinkedIn

LinkedIn

Staff

Comments

Your account is free and you can post anonymously if you choose.