GitHub interview question

Using map to find the duplicate