My Simple Python Solution - Using Type Conversion and List comprehensive


  • 0
    M
    class Solution(object):
        def plusOne(self, digits):
            """
            :type digits: List[int]
            :rtype: List[int]
            """
            temp = ''.join(str(n) for n in digits)
            return [int(a) for a in str(int(temp) + 1)]
    

Log in to reply
 

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