Linked List Loop Detection Leetcode Sql