ADP Interview Question

find duplicate in array within n time