fork download
  1. def up_array(arr)
  2. ((arr.join.to_i) + 1).to_s.chars.map(&:to_i) unless arr.any?{ |i| i < 0; return nil}
  3. end
  4.  
  5. p up_array([5, 7, 7])
Success #stdin #stdout 0.08s 9712KB
stdin
Standard input is empty
stdout
nil