We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b59c9c4 commit 933d239Copy full SHA for 933d239
src/me/ramswaroop/bits/MultipleOf3.java
@@ -49,3 +49,12 @@ public static void main(String a[]) {
49
System.out.println(isMultipleOf3(-17));
50
}
51
52
+
53
+/**
54
+ * Old School Method:
55
+ *
56
+ * If sum of digits in a number is multiple of 3 then number is multiple of
57
+ * 3 e.g., for 612 sum of digits is 9 so it’s a multiple of 3. But this solution
58
+ * is not efficient. You have to get all decimal digits one by one, add them and then check if sum is multiple of 3.
59
60
+ */
0 commit comments