Solve queue switch and coin change puzzles | Jane Street Interview Question