tortoise
and hare
to the first element of the array.tortoise
to nums[tortoise]
and hare
to nums[nums[hare]]
until they meet.tortoise
to the first element.tortoise
and hare
one step at a time (tortoise
to nums[tortoise]
and hare
to nums[hare]
) until they meet again.