How to implement a queue using stack? ( not this question, but this type of questions and the question many be more difficult than this.)
Anonymous
Push() values onto one stack. Pop() all values and reverse the order by pushing onto another stack. Now you have a stack that can pop() the very first value, followed by the rest of the values in order.
Check out your Company Bowl for anonymous work chats.