Easy
Given the head of a linked list, return true if it has a cycle. On this judge the input is the node values plus pos — the index the tail’s next connects to, or -1 for no cycle. pos is not passed to your function.
Input: head = [3,2,0,-4], pos = 1 Output: true
Input: head = [1], pos = -1 Output: false