Deque Class Python Coding Interview