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 662b98a commit a915dd4Copy full SHA for a915dd4
Python/clumsy-factorial.py
@@ -12,10 +12,10 @@
12
# if N = 2 => N
13
# if N = 3 => N + 3
14
# if N = 4 => N + 2 + 1 = N + 3
15
-# if N > 4 and N % 4 == 0 => N + 1 + (... = 0) + 5 - (4*3/2) + 1 = N + 1
16
# if N > 4 and N % 4 == 1 => N + 1 + (... = 0) + 2 - 1 = N + 2
17
# if N > 4 and N % 4 == 2 => N + 1 + (... = 0) + 3 - 2 * 1 = N + 2
18
# if N > 4 and N % 4 == 3 => N + 1 + (... = 0) + 4 - 3 * 2 / 1 = N - 1
+# if N > 4 and N % 4 == 0 => N + 1 + (... = 0) + 5 - (4*3/2) + 1 = N + 1
19
20
class Solution(object):
21
def clumsy(self, N):
0 commit comments