爬楼梯
const climbStairsFullStack = (n) => { if (n <= 2) { return n; } return climbStairsFullStack(n - 1) + climbStairsFullStack(n - 2); }; const climbStairs = (n = 10) => { const map = new Map(); const run = (n) => { if (n <= 2) return n; if (map.has(n)) return map.get(n); map.set(n, run(n - 1) + run(n - 2)); return map.get(n); }; return run(n); };
以自己现在的努力程度,还没有资格和别人拼天赋