Loading...
Given a list of values and an integer pos indicating where the tail connects to (0-indexed), determine if the linked list has a cycle.
pos is -1 if there is no cycle. Output True if there is a cycle, False otherwise.
3,2,0,-4 1
True
pos is 1, meaning the tail of the list connects to the node at index 1 (0-indexed), which has a value of 2.True.