We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee28bff commit 6548c23Copy full SHA for 6548c23
1 file changed
C++/integer-break.cpp
@@ -35,7 +35,7 @@ class Solution {
35
if (n % 3 == 0) { // n = 3Q + 0, the max is 3^Q * 2^0
36
res = pow(3, n / 3);
37
} else if (n % 3 == 2) { // n = 3Q + 2, the max is 3^Q * 2^1
38
- res = pow(3, n / 3) * 2;
+ res = pow(3, n / 3) * 2;
39
} else { // n = 3Q + 4, the max is 3^Q * 2^2
40
res = pow(3, n / 3 - 1) * 4;
41
}
0 commit comments