Skip to content

Instantly share code, notes, and snippets.

@jah2488
Created February 29, 2012 06:12
Show Gist options
  • Select an option

  • Save jah2488/1938405 to your computer and use it in GitHub Desktop.

Select an option

Save jah2488/1938405 to your computer and use it in GitHub Desktop.
Project Euler Problem 1
i = 0
nums = []
while i < 1000
nums << i if i%3 == 0 or if i%5 == 0
i+=1
end
nums.inject{|sum,i| sum + i }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment