Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 768 Bytes

File metadata and controls

27 lines (18 loc) · 768 Bytes

groupArrayElements

This coding challenge to demonstates some small executable code.

The groupArrayElements function should:

  • Given an array of length >= 0, and a positive integer N, return the contents of the array divided into N equally sized arrays.
  • Where the size of the original array cannot be divided equally by N, the final part should have a length equal to the remainder

How to get started

Install the required npm packages

npm i

Run tests

The following npm script will execute unit tests written in Jest

npm test

Other notes

Normally I'd use tools such as babel or TypeScript, webpack etc but didn't consider this a requirement for this coding challenge.

The best way to see the code in action is to run the tests.