Created
June 18, 2012 21:25
-
-
Save kaosf/2950821 to your computer and use it in GitHub Desktop.
9C4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 9C4.rb | wc -l #=> 126 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment