Interview question of the issue #268 of rendezvous with cassidoo.
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]
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!