Singly Linked List Leetcode Problems Python