Skip to content

Commit c019819

Browse files
committed
Time: 41 ms (91.50%), Space: 16.2 MB (68.06%) - LeetHub
1 parent 869a806 commit c019819

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

0258-add-digits/0258-add-digits.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution(object):
2+
def addDigits(self, num):
3+
while num > 9:
4+
num = num % 10 + num // 10
5+
return num

0 commit comments

Comments
 (0)