← Questions
Flatten a nested list iterator
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A list holds integers and other lists, nested to any depth. Write an iterator with next() and has_next() that returns the integers in order. Do it lazily with a stack of positions rather than flattening everything up front, and make sure empty inner lists are skipped.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
