HackerRank Collections.deque() in python problem solution - TheCScience