Find the Duplicate Number — binary search on the value
Don't search positions — search the answer. For a candidate value, count how many array elements are ≤ it. If that count is bigger than the value itself, the pigeonhole says a duplicate hides at or below it.
Try:
nums  (green = ≤ mid)
value range [1 … n]