#
# @lc app=leetcode.cn id=66 lang=python3
#
# [66] 加一
#

# @lc code=start
class Solution:
    def plusOne(self, digits: List[int]) -> List[int]:
        
        # if(digits[-1]!=9):
        #     digits[-1]+=1
        # else:
        #     n=len(digits)
        #     flag=1
        #     for i in range(n-1,-1,0):
        #         digits[i]=digits[i]+flag
        #         if(digits[i]==10):
        #             digits[i]=0
        #             flag=1
        #         else:
        #             flag=0
        return digits
# @lc code=end

