287. Find the Duplicate Number(Without Extra Space and Modifications to the array)

Опубликовано: 17 Май 2026
на канале: EverydayLeetcode
1,406
18

Summary and Takeaway:
1. This problem is similar to detecting a cycle in the linked list.
2. We keep 2 pointers here fast and slow to detect the cycle in the array.
3. Once we detect the cycle we detect the start of the cycle which is the duplicate number.