Build a first-in-first-out queue using only two stacks. Support push (add to the back), pop (remove from the front), peek (read the front) and empty, using only standard stack operations.
Build a first-in-first-out queue using only two stacks. Support push (add to the back), pop (remove from the front), peek (read the front) and empty, using only standard stack operations.