Edelman interview question

Write code to find duplicate element in an array ?