euler/ruby/euler009.rb

6 lines
130 B
Ruby
Raw Normal View History

require_relative 'euler'
2014-04-25 23:59:14 +00:00
def solution
Euler.generate_pythagorean_triples(500).find { |x| x.inject(:+) == 1000 }.inject(:*)
2014-04-25 23:59:14 +00:00
end