Skip to content

Latest commit

 

History

History

285-generateArrays

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

generateArrays

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

The Question

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]]

Installing & Running

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