Given the head of a linked list, determine if the linked list has a cycle in it. Return `true` if there is a cycle, otherwise return `false`.
head = head node of the linked list
true if a cycle exists, false otherwise
Example 1:
Input:
head = [3,2,0,-4]
Output:
false
Explanation:
There is a cycle connecting tail to node index 1.
Example 2:
Input:
head = [1,2]
Output:
false
Explanation:
Cycle connecting tail to first node.
Example 3:
Input:
head = [1]
Output:
false
Explanation:
Single node without cycle.