nestedList
reversed.hasNext()
to:
a. While the stack is not empty and the top is not an integer, pop the top list, reverse it, and push its elements onto the stack.
b. Return true
if the stack is not empty, false
otherwise.next()
to call hasNext()
and if true
, pop and return the top integer from the stack.