require_relative 'euler' def products_of_three_digits products = [] (100..999).each do |i| (100..999).each do |j| products << i*j end end products end def solution products_of_three_digits.select { |x| Euler.palindrome?(x) }.max end