```
def plusOne(self, digits):
p = []
carry = 1
for n in reversed(digits):
s = n + carry
if s > 10:
carry = s % 10
elif s == 10:
carry = 1
s = 0
else:
carry = 0
p = [s] + p
if carry:
p = [carry] + p
return p
```