Given a linked list. Find the distance from the head of the list to the node where cycle starts. If there is no cycle, return -1.
Definition of a single linked list:
Implement a function DistanceToCycle that returns the distance from the head of the list to the node where cycle starts. If there is no cycle, return -1.
Function DistanceToCycle returns -1 because this linked list does not contain a cycle.
Function DistanceToCycle returns 2 - the distance from the head of the list to the node where cycle starts. (1 → 2 → 3).