Skip to content

Instantly share code, notes, and snippets.

@hminaya
Last active December 16, 2015 19:00
Show Gist options
  • Save hminaya/5482289 to your computer and use it in GitHub Desktop.
Save hminaya/5482289 to your computer and use it in GitHub Desktop.
Segundo ejemplo en ruby
count = 0
File.open("seed.txt") do |f|
while line = f.gets
one, two = line.split(" ").map(&:to_i)
while (one <= two) do
one += 1
muestra = one.to_s
if muestra == muestra.reverse
count += 1
end
end
end
end
puts "\nFound: #{count}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment