Skip to content

Instantly share code, notes, and snippets.

@tuwukee
Last active August 29, 2015 14:10
Show Gist options
  • Save tuwukee/11b12c258d20d156be61 to your computer and use it in GitHub Desktop.
Save tuwukee/11b12c258d20d156be61 to your computer and use it in GitHub Desktop.
def palindrom?(str)
str == str.reverse()
end
puts (ARGV[0].to_i...ARGV[1].to_i).select { |n| palindrom?(n.to_s) && palindrom?(n.to_s(2)) }.reduce(:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment