Skip to content

Instantly share code, notes, and snippets.

@citizen428
Created January 9, 2012 23:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save citizen428/64db740e0d69d03d756e to your computer and use it in GitHub Desktop.
Solution to Lambdaheads 2012-01-09 challenge
str = [%w(YYYY MM DD), %w(YY MM DD)].map do |ss|
(1..ss.size).map { |n| ss.permutation(n).to_a }
end.flatten(2).uniq.map(&:join)
puts Regexp.union(str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment