euler/ruby/euler056.rb

12 lines
192 B
Ruby
Raw Normal View History

2014-12-05 00:52:58 +00:00
require_relative 'euler'
def solution
[].tap do |sums|
(1..100).each do |a|
(1..100).each do |b|
sums << (a ** b).to_digit_list.inject(:+)
end
end
end.max
end