My two-line python code


  • 1
    R
    class Solution(object):
        def plusOne(self, digits):
            """
            :type digits: List[int]
            :rtype: List[int]
            """
            Num = reduce( lambda x,y: 10*x + y, digits ) + 1;
            return(map(lambda x:int(x), list(str(Num))))
    

Log in to reply
 

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