Skip to content

Instantly share code, notes, and snippets.

@NewAlexandria
Created April 9, 2015 13:30
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 NewAlexandria/395aadc8f1bbd4ad1873 to your computer and use it in GitHub Desktop.
Save NewAlexandria/395aadc8f1bbd4ad1873 to your computer and use it in GitHub Desktop.
Outputs string combinatorics
r = ('a'..'z')
r.map{|l| r.map{|w| r.map{|q| q+w+l} } }.flatten
r.map{|l| r.map{|w| r.map{|q| r.map{|t| q+w+l+t } }} }.flatten.size
# add exclusions
# add recursion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment