linked list cycle 1&2 Python accepted