HackerRank Day 18: Queues and Stacks problem solution - TheCScience