Simple Python O(n) Solution without converting to a number
The idea here is to start from the right side.  As soon as we find a number that isn't 9 we can add 1 to it and return.  If the number is 9, we change it to 0 a
The idea here is to start from the right side.  As soon as we find a number that isn't 9 we can add 1 to it and return.  If the number is 9, we change it to 0 and continue until we find a number that is not 9 to carry the 1 to.  If we reach the end of array with all 9's we then insert the 1 in front of array. \n\n\n     def plusOne(self, digits):\n        for i in range(len(digits)-1, -1, -1):\n            digits[i] = digits[i] + 1 if digits[i] < 9 else 0\n            if digits[i]: \n                return digits\n        digits.insert(0, 1)\n        return digits
['Python']