Python Solution


  • 0
    Y
    class Solution(object):
        def plusOne(self, digits):
            """
            :type digits: List[int]
            :rtype: List[int]
            """
            r = 0
            for i in range(len(digits)):
                r += digits.pop() * (10 ** i)
            return [int(i) for i in str(r+1)]
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.