Voting for O(n)

With a simple std::unordered_set we can easily check for repeats as we iterate over the string once; with adding the seen char to the set at every index of the string.

Privacy & Terms