258. Add Digits python3


  • 0
    R
    class Solution:
        def addDigits(self, num):
            """
            :type num: int
            :rtype: int
            """
            while num >= 10:
                num = num // 10 + num % 10
                
            return num
    

Log in to reply
 

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