BNY interview question

Sorting of arrays into a whole separate array