Skip to content

Instantly share code, notes, and snippets.

@aycabta
Created September 28, 2012 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aycabta/3799994 to your computer and use it in GitHub Desktop.
Save aycabta/3799994 to your computer and use it in GitHub Desktop.
2^n include contiguous "0"
num = 1
1024.times do
num *= 2
p "oh...." if num.to_s.include? "0000"
end
# "oh...." is printed 11 times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment