Python recursive solution, very clean code


  • 0
    F

    '''
    class Solution(object):
    def addDigits(self, num):
    if num<10:
    return num
    else:
    return self.addDigits(num)
    '''
    Is it clean?


Log in to reply
 

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