Cisco interview question

removal of duplicate elements in array