Amazon interview question

Wave array, Find duplicate array