Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 561 Bytes

File metadata and controls

21 lines (13 loc) · 561 Bytes

separateAndSort

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

The Question

Given an array of integers, sort them into two separate sorted arrays of even and odd numbers. If you see a zero, skip it.

Example:

> separateAndSort([4,3,2,1,5,7,8,9])
> [[2,4,6], [1,3,5,7,9]]

> separateAndSort([1,1,1,1])
> [[], [1,1,1,1]]

Installing & Running

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