# Plus One

Given a non-negative number represented as an array of digits, plus one to the number.

The digits are stored such that the most significant digit is at the head of the list.

**Example**

Given [1,2,3] which represents 123, return [1,2,4].

Given [9,9,9] which represents 999, return [1,0,0,0].

## Solution

We can use a simple loop to add the result, with a carry variable.

At the end of the loop, carry would only be one if every digit of the input is 9, such as 999. In this case, the result is 1000.