Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Commit 08fab90

Browse files
authored
Merge pull request #546 from rkkksss/0258
Addded 258 Add digits
2 parents cdfddb9 + 9dc920f commit 08fab90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

LeetCode/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:
2+
def addDigits(self, num: int) -> int:
3+
if num < 10: return num
4+
if num % 9 == 0: return 9
5+
return num % 9

0 commit comments

Comments
 (0)