Skip to content

Instantly share code, notes, and snippets.

@evizitei
Created January 11, 2012 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evizitei/1595071 to your computer and use it in GitHub Desktop.
Save evizitei/1595071 to your computer and use it in GitHub Desktop.
ans = 0
for i in 100..999
for j in (100..999).to_a.reverse
x = i*j
if x == (x).to_s.reverse.to_i
ans = x
break
elsif x < ans
break
end
end
end
puts ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment