We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65b91fd commit f4b9875Copy full SHA for f4b9875
scripts/algorithms/G/Greatest Sum Divisible by Three/Greatest Sum Divisible by Three.java
@@ -1,3 +1,5 @@
1
+// Runtime: 11 ms (Top 68.46%) | Memory: 54.3 MB (Top 56.38%)
2
+
3
class Solution {
4
5
public int maxSumDivThree(int[] nums) {
@@ -26,7 +28,7 @@ public int maxSumDivThree(int[] nums) {
26
28
} else if (b % 3 == 2) {
27
29
nr2 = Math.max(nr2, b);
30
}
-
31
32
if (c % 3 == 0) {
33
nr0 = Math.max(nr0, c);
34
} else if (c % 3 == 1) {
@@ -38,7 +40,7 @@ public int maxSumDivThree(int[] nums) {
38
40
r1=nr1;
39
41
r2=nr2;
42
43
44
return r0;
45
-}
46
+}
0 commit comments