Solution to the Stacks && Queues problem.