Leetcode Doubly Linked List Problems In Python