Problem

Given an array of integers of any length, return an array that has 1 added to the value represented by the array.

Conditions

  • the array can't be empty
  • only non-negative, single digit integers are allowed
  • Return nil for invalid inputs.

Examples

For example the array [2, 3, 9] equals 239, adding one would return the array [2, 4, 0].

[4, 3, 2, 5] would return [4, 3, 2, 6]

Acceptance criteria

  • The solution is written using idiomatic ruby
  • There are tests to verify the correctness of your solution

Setup

  • clone or download repo using git@github.com:Kalunge/array_plus.git cd into array_plus run bundle install then run rspec