Skip to content

Instantly share code, notes, and snippets.

@aptinio
Created November 4, 2009 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aptinio/225901 to your computer and use it in GitHub Desktop.
Save aptinio/225901 to your computer and use it in GitHub Desktop.
Project Euler Problem 6
(1..100).to_a.reduce(:+)**2 - (1..100).to_a.reduce {|sum_of_squares, n| sum_of_squares + n**2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment