Tech Mahindra interview question

How to check duplicate