Last active
August 17, 2017 12:22
-
-
Save eduardopoleo/7793ee33b09dbe1b9df72b3aa3765c17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def unique_with_array(s) | |
| char_set = Array.new | |
| s.each_char do |char| | |
| code = char.ord | |
| return false if char_set[code] | |
| char_set[code] = true | |
| end | |
| return true | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment