CitiusTech Interview Question

How to get duplicate elements in int array, the most sufficient way