Saasfocus interview question

duplicate elements in array coding