Skip to content

Commit

Permalink
Add_Digits_LeetCode 258
Browse files Browse the repository at this point in the history
Initial File
  • Loading branch information
netsetos authored Jul 27, 2020
1 parent a54c29f commit 8ab0da5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Add_Digits_LeetCode 258
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution(object):
def addDigits(self, num):
"""
:type num: int
:rtype: int
"""
if num == 0:
return 0
if num % 9==0:
return 9
return (num%9)

0 comments on commit 8ab0da5

Please sign in to comment.