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 a915dd4 commit 153b0efCopy full SHA for 153b0ef
C++/clumsy-factorial.cpp
@@ -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 {
21
public:
0 commit comments