Amazon Interview Question

Wave array, Find duplicate array