'Array shuffling' problem hackerearth

I am not able to solve the problem and editorial is also not given
link - https://www.hackerearth.com/practice/algorithms/dynamic-programming/introduction-to-dynamic-programming-1/practice-problems/algorithm/array-shuffling/

This is the code https://ide.codingblocks.com/s/245372, the code is self explanatory,as it is just checking all the possibilities of answer by checking the combinations using dp

Understood
Thank you!

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.