Collection.deque() | HackerRank Solution