Approach hintTry it first, then revealHide
Treat the array as a linked structure in which index i points to nums[i]; the duplicate value is the entrance of the cycle this creates. Floyd's slow and fast pointers find it without modifying the array.