DevRev Interview Question

Code to get duplicates from an array.?