Skip to content

Instantly share code, notes, and snippets.

@apeiros
Created April 19, 2014 14:44
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 apeiros/11086444 to your computer and use it in GitHub Desktop.
Save apeiros/11086444 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby -w
# grab the input, convert it, sum it, and spit out the answer
$stdin.each_line do |line|
puts line.scan(/\d+/).map(&:to_i).reduce(:+)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment