Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 647 Bytes

File metadata and controls

24 lines (15 loc) · 647 Bytes

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!