为了账号安全,请及时绑定邮箱和手机立即绑定

关于递归问题

关于递归问题

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));为什么当到达63后current会慢慢减小,搞不懂,希望大佬解释下
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 825 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信