Publicis Sapient interview question

1.WAP to find the duplicate element in array.