Updating exercises

This commit is contained in:
Carlos
2025-07-14 10:09:13 -04:00
parent 57956bf728
commit 7f1381ae93
25 changed files with 634 additions and 13 deletions

View File

@@ -0,0 +1,19 @@
// @leet start
/**
* @param {number} n
* @return {number}
*/
const fibonacci = (element, cache = []) => {
if (element === 0) return 0;
if (element === 1) return 1;
if (cache[element]) return cache[element];
cache[element] = fibonacci(element - 2, cache) + fibonacci(element - 1, cache);
return cache[element];
}
var climbStairs = function(n) {
const array = fibonacci(n + 1)
return array
};
// @leet end