【leetcode】258. Add Digits

题目如下:

解题思路:题目很简单,没啥说的。Follow up 我还没想出来。

代码如下:

class Solution(object):
    def addDigits(self, num):
        """
        :type num: int
        :rtype: int
        """
        while num >= 10:
            num = sum([int(x) for x in list(str(num))])
        return num
原文地址:https://www.cnblogs.com/seyjs/p/9479348.html