@@ -0,0 +1,834 @@
+import java.util.Iterator;%0Aimport java.util.List;%0Aimport java.util.Stack;%0A%0Apublic class _341FlattenNestedListIterator implements Iterator%3CInteger%3E %7B%0A%09Stack%3CNestedInteger%3E stack = new Stack%3CNestedInteger%3E();%0A%09%0A    public _341FlattenNestedListIterator(List%3CNestedInteger%3E nestedList) %7B%0A    %09for (int i = nestedList.size() - 1; i %3E= 0; i--) stack.push(nestedList.get(i));%0A    %7D%0A%0A    @Override%0A    public Integer next() %7B%0A    %09return stack.pop().getInteger();%0A    %7D%0A%0A    @Override%0A    public boolean hasNext() %7B%0A        while (!stack.isEmpty()) %7B%0A        %09NestedInteger ni = stack.peek();%0A        %09if (ni.isInteger()) return true;%0A        %09stack.pop();%0A        %09List%3CNestedInteger%3E nestedList = ni.getList();%0A        %09for (int i = nestedList.size() - 1; i %3E= 0; i--) stack.push(nestedList.get(i));%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

Add 341 solution