Another way in Python

  • 0
    def plusOne(self, digits):
        :type digits: List[int]
        :rtype: List[int]
        s = map(str, digits)   
        s = ''.join(s)        
        s = int(s)            
        s += 1
        s = str(s)
        a = []
        length = len(s)
        for i in range(0, length):
        a = map(int, a)
        return a

Log in to reply

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