function findSolution(target) {? function find(current, history) {? ? if (current == target) {? ? ? return history;? ? } else if (current > target) {? ? ? return null;? ? } else {? ? ? return find(current + 5, `(${history} + 5)`) ||? ? ? ? ? ? ?find(current * 3, `(${history} * 3)`);? ? }? }? return find(1, "1");}console.log(findSolution(24));為什么當(dāng)?shù)竭_(dá)63后current會(huì)慢慢減小,搞不懂,希望大佬解釋下
關(guān)于遞歸問(wèn)題
我要去幼兒園深造了
2018-06-14 10:15:27