Infosys interview question

find duplicates from an array