```
int *plusOne(int *digits, int len, int *newLen) {
int n = len-1;
while(n>=0){
if(digits[n]<9){
digits[n]+=1;
*newLen=len;
return digits;
} else {
digits[n] =0;
--n;
}
}
digits = (int *)realloc(digits,(len+1)*sizeof(int));
if(NULL == digits)
exit(-1);
*newLen = len +1;
n = len;
while(n>0){
digits[n] = digits[n-1];
--n;
}
digits[0]=1;
return digits;
}
```

code above got a runtime error on OJ. and Last executed input: [1].

but it runs well on my own machine.even with the last UC. I can't figure it out.help me please~