Question d’entretien chez SAP

Create a function that will print the sequence within a string with only unique characters. (Read through each character, and if there is a repeat then print out the sequence without the repeat)

Réponse à la question d'entretien

Utilisateur anonyme

4 mai 2017

I used a hash map in C++ to store and check each character as I iterated through the string. For each iteration, I would check to see if it existed in the map. If the character was in the map, print out the current sequence, otherwise add the character to the map and continue iterating