Interview question of the issue #285 of rendezvous with cassidoo.
Given a positive integer, generate an array in which every element is an array that goes from 1 to the index of that array.
Example:
> generateArrays(4)
> [[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]
> generateArrays(1)
> [[1]]
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!