Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 213 Bytes

README.md

File metadata and controls

3 lines (2 loc) · 213 Bytes

This problem was asked by Google.

You are given an array of length n + 1 whose elements belong to the set {1, 2, ..., n}. By the pigeonhole principle, there must be a duplicate. Find it in linear time and space.