Created
February 12, 2015 00:24
-
-
Save WA9ACE/0dd9764786ecbdd7c564 to your computer and use it in GitHub Desktop.
Quick and dirty, not tested.
This file contains 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 nearby_az(string) | |
raise ArgumentError if !string.include? 'a' | |
a_idx = string.index("a") | |
string[a_idx + 1] == "z" || string[a_idx + 2] == "z" || string[a_idx +3] == "z" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment