Find the largest palindrome made from the product of two 3-digit numbers.
找到能表示成两个三位数乘积的最大的回文数。
思路就是遍历所有三位数的乘积判断是不是回文数,再选出最大的来
result = 0 999.downto(100) do |x| 999.downto(100) do |y| if (x * y).to_s.reverse == (x * y).to_s result = [result, x*y].max end end end p result