Created
May 14, 2013 22:52
-
-
Save motdotla/5580334 to your computer and use it in GitHub Desktop.
This file contains 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
days = [1,2,3,4,5,6,7,8,9,10] | |
tickets = [1,2,3,4,5,6] | |
results = [] | |
days.each do |day| | |
days.each do |day2| | |
if day2 != day | |
tickets.each do |ticket| | |
result = "#{ticket} on day #{day} and #{tickets.length-ticket} on day #{day2}" | |
results << result | |
puts result | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment