Is Cycle Present In Linkedlist
easy
1. Given a singly linklist. determine if the linked list has a cycle in it. 2. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer.
Constraints
0 <= N <= 10^6
Format
Input
input is handle for you
Output
output is handle for you.
Example
Sample Input
8
1
18
1
8
-1
138
31
84
3
Sample Output
true