Skip to content

Latest commit

 

History

History

268-fibLike

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

fibLike

Interview question of the issue #268 of rendezvous with cassidoo.

The Question

Given two integers, generate a "fibonacci-like" sequence of n digits (where the next number in the pattern is the sum of the previous two numbers). Extra credit: Given a sequence, determine if the sequence is “fibonacci-like”.

Example:

let n = 5

> fibLike(10, 20, n)
> [10, 20, 30, 50, 80]

> fibLike(3, 7, n)
> [3, 7, 10, 17, 27]

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!