Find the duplicate number without modifying the array
Asked at Jane Street
You are handed an array nums of length where every value is between and inclusive. By the pigeonhole principle at least one value repeats, and in this problem exactly one value repeats (possibly many times).
Find the duplicate using extra space, without modifying the array. Sorting or a hash set are the easy answers, the interviewer wants neither.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.