CitiusTech interview question

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