Jane Street Interview Question

Question on manipulating arrays, prefix/suffix