Skip to main content
-4 bytes
Source Link
daniero
  • 18.8k
  • 5
  • 52
  • 79

Ruby, 1919 15 bytes

Loving that new #sum in Ruby 2.4 :)

p$<.mapsum(&:to_i).sum 

This program accepts input from either stdin or any filename(s) given as command line argument

Ruby, 19 bytes

Loving that new #sum in Ruby 2.4 :)

p$<.map(&:to_i).sum 

This program accepts input from either stdin or any filename(s) given as command line argument

Ruby, 19 15 bytes

Loving that new #sum in Ruby 2.4 :)

p$<.sum(&:to_i) 

This program accepts input from either stdin or any filename(s) given as command line argument

Source Link
daniero
  • 18.8k
  • 5
  • 52
  • 79

Ruby, 19 bytes

Loving that new #sum in Ruby 2.4 :)

p$<.map(&:to_i).sum 

This program accepts input from either stdin or any filename(s) given as command line argument