## --DAY 12--

Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.

**Now let's solve problem today:**

-Problem: Plus One

-Detail: here

-My solution (javascript):

```
var plusOne = function(digits) {
let i=digits.length-1;
while(i>=0){
if(i==0&&digits[0]==9){
digits[i]=0; digits.unshift(1);
return digits;
}
digits[i]+=1;
if(digits[i]!=10) return digits;
else{
digits[i]=0;
i--;
}
}
return digits;
};
```

-->*If you have better solution or any question, please comment below. I will appreciate.*

## Top comments (3)

i've copied it and it's not working in all cases

Oh sorry. I overlooked the max size of this array. i fix it and post again...