SAP interview question

Write code to find the duplicate entry in an array.