LeetCode 287: Find the Duplicate Number — Floyd’s Cycle Detection Explained
The duplicate creates a cycle because two indices eventually lead to the same node. Floyd’s Tortoise and Hare algorithm detects that cycle without modifying the array. Resetting one pointer to the start lets you find the cycle entrance, which is the duplicate number.
