GitHub Interview Question

Using map to find the duplicate