Nested Integer类
Typical iterator should succeed as well in situation:
next() call without hasNext() call
multiple hasNext() calls
Flatten Nested List Iterator
Iterator的题首先要想到满足两个条件
next() call without hasNext() call
multiple hasNext() calls
push nestedList to a stack in reverse order, so that stack.peek() would be first NestedInteger
一般都把logic写在hashNext()里
Nested list weight sum
Last updated
Was this helpful?