2020-1: Let"s Split!

Write code that, given a second argument Y which is a scalar or a non-empty vector and a first argument X which is a single non-zero integer so that its absolute value is less or equal to ≢Y, splits Y into a vector of two vectors according to X, as follows: - If X>0, the first vector contains the first X elements of Y and the second vector contains the remaining elements. - If X<0, the second vector contains the last |X elements of Y and the first vector contains the remaining elements.

Examples

Implementation

You can also run the tests via ⌘/shift + enter