fork download
  1. while s = gets
  2. digits = s[0] == '-' ? [-s[1].to_i] + s[2..-1].each_char.to_a : s.each_char
  3. puts s.to_i + s.strip.size + digits.map(&:to_i).inject(&:+)
  4. end
Success #stdin #stdout 0.05s 9616KB
stdin
99
-123
stdout
119
-115