fork download
  1. 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(&:+)
Success #stdin #stdout 0.06s 9712KB
stdin
-123
stdout
-115