We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a54c29f commit 8ab0da5Copy full SHA for 8ab0da5
1 file changed
Add_Digits_LeetCode 258
@@ -0,0 +1,12 @@
1
+class Solution(object):
2
+ def addDigits(self, num):
3
+ """
4
+ :type num: int
5
+ :rtype: int
6
7
+ if num == 0:
8
+ return 0
9
+ if num % 9==0:
10
+ return 9
11
+ return (num%9)
12
+
0 commit comments