#141 - Linked List Cycle
Given head, the head of a linked list, determine if the linked list has a cycle in it. A cycle exists if some node can be reached again by continuously following next. Return true if there is a cycle, false otherwise.
| Input | Output |
|---|---|
head = [3,2,0,-4], tail connects to index 1 | true |
head = [1,2], tail connects to index 0 | true |
head = [1], no cycle | false |