Find first duplicate number in an array containing numbers from 1 to n

mediumLast edited: August 2, 2025