Why return None?


  • 0
    V
    def addDigits(num):
        """
        :type num: int
        :rtype: int
        """
        shit = str(num)
        n = len(shit)
        if n == 1:
            return num
        else:
            num = 0
            for i in xrange(n):
                num += int(shit[i])
            addDigits(num)
    

Log in to reply
 

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