Skip to content

Commit

Permalink
Merge pull request #238 from hellomrsun/master
Browse files Browse the repository at this point in the history
Add Add Digits C#
  • Loading branch information
mincong-h authored Jul 26, 2020
2 parents 2b5009a + 6fc3339 commit 5dd7167
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions July-LeetCoding-Challenge/26-Add-Digits/Add-Digits.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class Solution {
public int AddDigits(int num) {
if(num == 0) return 0;
if(num % 9 == 0) return 9;
else return num % 9;
}
}

0 comments on commit 5dd7167

Please sign in to comment.