Easy Python solution O(n)
\n    def plusOne(digits):\n        digits[-1] += 1\n        for i in range(len(digits)-1, 0, -1):\n            if digits[i] != 10:\n                break\n    
\n    def plusOne(digits):\n        digits[-1] += 1\n        for i in range(len(digits)-1, 0, -1):\n            if digits[i] != 10:\n                break\n            digits[i] = 0\n            digits[i-1] += 1\n        \n        if digits[0] == 10:\n            digits[0] = 0\n            return [1] + digits\n        return digits
['Python']