Split array(recursion)

Question ide
https://hack.codingblocks.com/app/contests/949/p/511
i am unable to code this question.kindly help