Skip to content

Instantly share code, notes, and snippets.

@BlakeWilliams
Created September 20, 2011 22:13
Show Gist options
  • Save BlakeWilliams/1230575 to your computer and use it in GitHub Desktop.
Save BlakeWilliams/1230575 to your computer and use it in GitHub Desktop.
Project Euler #1 in one line
(1..999).select { |x| (x % 3) == 0 || (x % 5) == 0 }.reduce(:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment