Search
The function splitArray should return sub-arrays, where each of their maximum length should be equal to maxlen parameter passed as one of the input.
splitArray
maxlen
map
filter
For example: