Leetcode Daily Question
2.46K subscribers
517 files
2.16K links
Why are you asking me to do Leetcode for this CSS job?
Download Telegram
Leetcode-cn.com 2022-03-03
🟢 258.add-digits

🏷️ Tags
#math #number_theory #simulation

Description
给定一个非负整数 num,反复将各个位上的数字相加,直到结果为一位数。返回这个结果。

Example
输入: num = 38
输出: 2
解释: 各位相加的过程为:
38 --> 3 + 8 --> 11
11 --> 1 + 1 --> 2
由于 2 是一位数,所以返回 2。