We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b456d5 commit cd289b1Copy full SHA for cd289b1
EASY/src/easy/AddDigits.java
@@ -0,0 +1,11 @@
1
+package easy;
2
+
3
+public class AddDigits {
4
+//only three cases as the code shows
5
+ public int addDigits(int num) {
6
+ if(num == 0) return 0;
7
+ if(num % 9 == 0) return 9;
8
+ return num%9;
9
+ }
10
11
+}
0 commit comments