RenderPub interview question

Find the duplicate element in an array