2014-11-20 19:38:31 +00:00
|
|
|
require_relative 'euler'
|
2014-04-25 23:59:14 +00:00
|
|
|
|
2014-11-20 19:38:31 +00:00
|
|
|
def products_of_three_digits
|
2018-02-21 21:00:08 +00:00
|
|
|
(100..999).to_a.combination(2).map { |p| p.inject(:*) }
|
2014-04-25 23:59:14 +00:00
|
|
|
end
|
|
|
|
|
2014-11-20 19:38:31 +00:00
|
|
|
def solution
|
|
|
|
products_of_three_digits.select { |x| Euler.palindrome?(x) }.max
|
2014-04-25 23:59:14 +00:00
|
|
|
end
|