Skip to content

Instantly share code, notes, and snippets.

@eduardopoleo
Last active August 16, 2017 18:38
Show Gist options
  • Save eduardopoleo/bb8c184e804e20a168589ad16e87338b to your computer and use it in GitHub Desktop.
Save eduardopoleo/bb8c184e804e20a168589ad16e87338b to your computer and use it in GitHub Desktop.
def unique_with_hash2(s)
characters = {}
s.each_char do |char|
return false if characters[char]
characters[char] = true
end
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment