Frage im Vorstellungsgespräch bei Google

Remove duplicate characters from a string

Antworten zu Vorstellungsgespräch

Anonym

28. Juni 2014

Use an array[260] or array[130] to indicate whether a character is found or not.

1

Anonym

10. Sep. 2014

Or better, you can use a bit vector if you make sure that the characters are from a-z. linear running time O(n) and O(1) space with just using one int variable.