A linked list is said to contain a cycle if any node is visited more than once while traversing the list. For example, in the following graph there is a cycle formed when node points back to node .
Complete the function has_cycle in the editor below. It must return a boolean true if the graph contains a cycle, or false.
has_cycle has the following parameter(s):
Note: If the list is empty, will be null.
There is no input for this challenge. A random linked list is generated at runtime and passed to your function.
The following linked lists are passed as arguments to your function: