Status: IN
The solution finds the duplicate via set-based detection, then derives the missing number algebraically using the Gauss sum formula `n*(n+1)//2` rather than searching for it — a pattern shared with `missing-number` and similar 1-to-n range problems.