Plus-one, just one line python


  • 0
    H
    class Solution(object):
        def plusOne(self, digits):
            """
            :type digits: List[int]
            :rtype: List[int]
            """
            return [int(j) for j in list(str(int(''.join([str(i) for i in digits])) + 1))]
    

Log in to reply
 

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