Skip to main content
Find the Duplicate Number | AlgoCracked
AlgoCracked
ProblemsFind the Duplicate Number
Medium59.0% acceptance
Blind75ArrayTwo PointersBinary SearchBit Manipulation

Find the Duplicate Number

You are given an array nums of n + 1 integers where every value lies in the range [1, n] . By the pigeonhole principle at least one value repeats; here exactly one number is repeated, though it may appear more than twice. Return that repeated number. Input format Input is a single array, e.g. [[1,3,4,2,2]] .

Loading workspace…