# Plus One (Leetcode 66)

Problem Link: <https://leetcode.com/problems/plus-one/>

```python
class Solution:
    def plusOne(self, digits: List[int]) -> List[int]:
        
        ans=digits[::-1]
        if(ans[0]!=9):
            ans[0]=ans[0]+1
            return ans[::-1]
        else:
            c=1
            for i in range(len(ans)):
                if(ans[i]==9 and c==1):
                    ans[i]=0
                else:
                    ans[i]=ans[i]+c
                    c=0
            if(c==1):
                ans.append(1)
            return ans[::-1]
```
