Skip to content

Instantly share code, notes, and snippets.

@Christian-G
Created October 24, 2016 15:11
Show Gist options
  • Save Christian-G/6747bba71c648d7f121e63347959aa28 to your computer and use it in GitHub Desktop.
Save Christian-G/6747bba71c648d7f121e63347959aa28 to your computer and use it in GitHub Desktop.
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