Given `head`, the head of a linked list, determine if the linked list has a **cycle** in it.
There is a cycle if some node can be reached again by continuously following the `next` pointer. Internally, `pos` is used to denote the index of the node that tail's `next` pointer is connected to (0-indexed). Note that `pos` is not passed as a parameter.
Return `true` if there is a cycle, otherwise return `false`.
**Example 1:**
```
Input: head = [3,2,0,-4], pos = 1
Output: true
Explanation: Tail connects to node at index 1.
```
**Example 2:**
```
Input: head = [1,2], pos = 0
Output: true
```
**Example 3:**
```
Input: head = [1], pos = -1
Output: false
```
Can you solve it using O(1) memory (Floyd's cycle detection)?