코드스테이츠[데일리22.fibonacci]

이유정·2022년 10월 27일
0
function fibonacci(n) {
  let memo = [0,1]
  const aux = (n) =>{
    if(memo[n] !== undefined) return memo[n]
    memo[n] = aux(n-2) + aux(n-1)
    return memo[n]
  }
  return aux(n)
}
profile
팀에 기여하고, 개발자 생태계에 기여하는 엔지니어로

0개의 댓글