how to find duplicate elements from the array