232. Implement Queue using Stacks
# Easy
straight forward, stack1 is the main stack, stack2 is the help stack. In push()
and peek()
, pop
all elements of stack1 to stack2, and then push
back to stack1.
Last updated
# Easy
straight forward, stack1 is the main stack, stack2 is the help stack. In push()
and peek()
, pop
all elements of stack1 to stack2, and then push
back to stack1.
Last updated