umdreamer / leetcodeproblems

Solutions for LeetCode OJ
3 stars 9 forks source link

2023.6.6 Problem: 258. Add Digits #32

Closed umdreamer closed 1 year ago

umdreamer commented 1 year ago
  1. Add Digits Problem Link

Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.

Example 1:

Input: num = 38
Output: 2
Explanation: The process is
38 --> 3 + 8 --> 11
11 --> 1 + 1 --> 2 
Since 2 has only one digit, return it.

Example 2:

Input: num = 0
Output: 0

Constraints:

686xiaozhang commented 1 year ago

QQ截图20230606214731

zxm-1235 commented 1 year ago

image

yeyuxq commented 1 year ago

image

Lggg1234 commented 1 year ago

屏幕截图 2023-06-05 115542

24zlx commented 1 year ago

联想截图_20230607123828

ZWJ2212061008 commented 1 year ago

image

123lrb commented 1 year ago

{@1C8U{L}5WW@M}HE6NEVEW

tangyexi commented 1 year ago
屏幕截图 2023-06-07 152242
sjh397 commented 1 year ago

image

PinkyLame commented 1 year ago

image

syr2212061031 commented 1 year ago

FM1 YXV14{}DWN9CDF7(FGA

promisewith7 commented 1 year ago

image

mafanjia commented 1 year ago

258

daowuwu commented 1 year ago

)S~PYO_K3AZ2P2Z54BJGBRG

zhjingyan commented 1 year ago

image

cuixiao02 commented 1 year ago
截屏2023-06-07 16 44 27
bedauern commented 1 year ago
Snipaste_2023-06-07_16-53-54
wangshiqi7 commented 1 year ago
截屏2023-06-07 17 16 44
1125766961 commented 1 year ago

image

gusuning commented 1 year ago
屏幕截图 2023-06-07 172655
liuhuanyu6 commented 1 year ago

image

liu-si-han commented 1 year ago
image
12baoxingyu-6 commented 1 year ago
image
xkqwww commented 1 year ago

1

zyhzxy99 commented 1 year ago

$_UE66)C UXJXR67N$LXR3F

FXL1006 commented 1 year ago
屏幕截图 2023-06-07 213621
xiaolu2002 commented 1 year ago

image

foxbou commented 1 year ago

image