Skip to content

Instantly share code, notes, and snippets.

@kaosf
Created June 18, 2012 21:25
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 kaosf/2950821 to your computer and use it in GitHub Desktop.
Save kaosf/2950821 to your computer and use it in GitHub Desktop.
9C4
(1..9).each do |i1|
(2..9).each do |i2|
(3..9).each do |i3|
(4..9).each do |i4|
if i1 < i2 && i2 < i3 && i3 < i4
print("#{i1}#{i2}#{i3}#{i4}\n")
end
end
end
end
end
ruby 9C4.rb | wc -l #=> 126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment