Floyd's Cycle detection algorithm | Determining the starting point of cycle
You can refer to &quot;Detecting start of a loop in singly linked list&quot;, here's an excerpt:

Distance travelled by slowPointer before meeting $= x+y$
Distance travelled by fastPointer before meeting $=(x + y + z) + y = x + 2y + z$
Since fastPointer travels with double the speed of slowPointer, and time is constant for both when both pointers reach the meeting point. So by using simple speed, time and distance relation (slowPointer traveled half the distance):
\begin{align*}
2*\operatorname{dist}(\text{slowPointer}) &amp;= \operatorname{dist}(\text{fastPointer})\\
2(x+y) &amp;= x+2y+z\\
2x+2y &amp;= x+2y+z\\
x &amp;= z
\end{align*}
Hence by moving slowPointer to start of linked list, and making both slowPointer and fastPointer to move one node at a time, they both have same distance to cover.
They will reach at the point where the loop starts in the linked list.