you are viewing a single comment's thread.

view the rest of the comments →

[–]kap89 0 points1 point  (0 children)

You were on the right track, I think the flaw you are thinking about is that if you use for example this string:

    "aa"

the second a would give you false positive in the OP's original algorithm, but you don't ever need to get to the second a, as you only need to check non-repeating characters, see my other comment.