Linked List Cycle Leetcode Solution Python