Arrays

Find Duplicate Number

medium
Given an array of integers `nums` containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number. Return that number. Constraints (treat as interview rules): you must not modify the array and use only constant extra space. (Hash sets work for practice but prefer Floyd cycle.)
Hint steps(0/2 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.