Created
October 24, 2016 15:11
-
-
Save Christian-G/6747bba71c648d7f121e63347959aa28 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 find_aaaab(s) | |
counter_a = 0 | |
s.split("").each do |c| | |
if c == 'a' | |
counter_a += 1 | |
elsif (c == 'b' && counter_a >= 4) | |
return true | |
else | |
counter_a = 0 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment