Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
How can you reduce the problem to checking if there is a valid partition for a smaller array?
Use dynamic programming to reduce the problem until you have an empty array.