Frage im Vorstellungsgespräch bei Genesys

Find the duplicate elements in an array without using additional data structure.

Antwort im Vorstellungsgespräch

Anonym

19. Juli 2018

1. sort the array and find adjacent elements 2. traverse the array and make arr[arr[i]] negative if it is positive, if you find negative while traversing it is a duplicate element, a disclaimer - array consist of positive elements