nference interview question

Find the Duplicate Number (LC -287)