Skip to content

Instantly share code, notes, and snippets.

@motdotla
Created May 14, 2013 22:52
Show Gist options
  • Save motdotla/5580334 to your computer and use it in GitHub Desktop.
Save motdotla/5580334 to your computer and use it in GitHub Desktop.
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