Skip to content

Instantly share code, notes, and snippets.

@vznvzn
Created March 12, 2016 06:28
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 vznvzn/04a99bbe15b33f4b0f66 to your computer and use it in GitHub Desktop.
Save vznvzn/04a99bbe15b33f4b0f66 to your computer and use it in GitHub Desktop.
def expand(l)
l2 = []
l.each \
{
|x|
l2 << '10' + x[1..-1]
l2 << '11' + x[1..-1]
}
return l2
end
l = ['1']
p(l)
5.times { l = expand(l); p(l) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment