merge: Add FibonacciNumber.js test case and update the decription of function. (#840)

This commit is contained in:
YATIN KATHURIA
2021-11-20 16:21:25 +05:30
committed by GitHub
parent f379475723
commit 93e57b0de5
2 changed files with 26 additions and 2 deletions

View File

@ -1,5 +1,10 @@
// https://en.wikipedia.org/wiki/Fibonacci_number
/**
* @function Fibonacci
* @description Fibonacci is the sum of previous two fibonacci numbers.
* @param {Integer} N - The input integer
* @return {Integer} fibonacci of N.
* @see [Fibonacci_Numbers](https://en.wikipedia.org/wiki/Fibonacci_number)
*/
const fibonacci = (N) => {
// creating array to store values
const memo = new Array(N + 1)