Python 2 line, 33ms, 91.79%


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

Log in to reply
 

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