euler/ruby/euler009.rb

6 lines
130 B
Ruby

require_relative 'euler'
def solution
Euler.generate_pythagorean_triples(500).find { |x| x.inject(:+) == 1000 }.inject(:*)
end