Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 538 Bytes

README.md

File metadata and controls

37 lines (25 loc) · 538 Bytes

Array Odometer

Given an array of positive numbers, write a method, that "adds one" to the "number" represented by the array, like an odometer.

Sample inputs and outputs

Input:
    [4, 3, 9, 5]

Output:
    [4, 3, 9, 6]
Input:
    [4, 3, 4, 9]

Output:
    [4, 3, 5, 0]
Input:
    [9, 9, 9, 9]

Output:
    [1, 0, 0, 0]

Questions and Answers

  • The array will always be positive integers
  • You must modify the array IN PLACE
  • You will need to code the reverse method as well as the odometer logic