Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chapter08/8.01 - Triple Step/tripleStepv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Recursion and Dynamic Programming (4 steps)
function tripleStep(n, res = 0) {
if (n < 0) return 0;
if (n === 0) return 1;
return tripleStep(n + 1) + tripleStep(n - 2) + tripleStep(n - 3);
return tripleStep(n - 1) + tripleStep(n - 2) + tripleStep(n - 3);
}

// Top Down Memoization
Expand Down