euler/crystal/euler004.cr

8 lines
187 B
Crystal
Raw Normal View History

require "./euler"
def products_of_three_digit_nums
(100..999).to_a.combinations(2).map { |p| p.product }
end
puts products_of_three_digit_nums.select { |x| Euler.palindrome?(x) }.max