My python 4 lines solution


  • 0
    B
    def plusOne(self, digits):
    	num = 0
    	for i, val in enumerate(digits[::-1]):
    		num += val * (10**i)
    	return [int(i) for i in str(num+1)]

Log in to reply
 

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