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 6548c23 commit e6d63f0Copy full SHA for e6d63f0
1 file changed
Python/integer-break.py
@@ -52,7 +52,7 @@ def integerBreak(self, n):
52
if n % 3 == 0: # n = 3Q + 0, the max is 3^Q * 2^0
53
res = 3 ** (n // 3)
54
elif n % 3 == 2: # n = 3Q + 2, the max is 3^Q * 2^1
55
- res = 3 ** (n // 3) * 2
+ res = 3 ** (n // 3) * 2
56
else: # n = 3Q + 4, the max is 3^Q * 2^2
57
res = 3 ** (n // 3 - 1) * 4
58
return res
0 commit comments