coMakeIT Interview Question

How to print duplicate elements in an array?