Ad
  • Custom User Avatar

    what about my attempt? saving a flag by character

  • Default User Avatar

    You know, after rethinking, I think a map, while taking more memory, would require less iterations than using strings.Index or strings.LastIndex like I used. I guess it's a tradeoff.

  • Default User Avatar

    Don't see a need for a map or rune here. This looks like you are counting runes but since you only need to know if the characters occur more than once, you don't need to keep track of the count. Therefore, you don't need a map.

    You also don't need to use rune here since the question explicitly says letters and numbers only.