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 88b95fd commit 9553d47Copy full SHA for 9553d47
chapter08/8.01 - Triple Step/tripleStepv2.js
@@ -11,7 +11,7 @@ Recursion and Dynamic Programming (4 steps)
11
function tripleStep(n) {
12
if (n < 0) return 0;
13
if (n === 0) return 1;
14
- return tripleStep(n + 1) + tripleStep(n - 2) + tripleStep(n - 3);
+ return tripleStep(n - 1) + tripleStep(n - 2) + tripleStep(n - 3);
15
}
16
17
// Top Down Memoization
0 commit comments