My Python Solution (48ms)


  • 0
    J
    class Solution:
        # @param {integer[]} digits
        # @return {integer[]}
        def plusOne(self, digits):
            count = len(digits)-1
            total = 0
            for a in digits:
                total += a*(10**count)
                count -= 1
            total += 1
            newList =[]
            for a in str(total):
                newList.append(int(a))
            return newList

Log in to reply
 

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