Skip to content

Instantly share code, notes, and snippets.

@charlesponti
Created May 7, 2013 14:05
Show Gist options
  • Save charlesponti/5532813 to your computer and use it in GitHub Desktop.
Save charlesponti/5532813 to your computer and use it in GitHub Desktop.
Project Euler: Problem 1
def three_five(max)
nums = []
1.upto(max-1) { |i| nums << i if i % 3 == 0 || i % 5 == 0 }
p nums.reduce(:+)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment