Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
When we use a subarray, the room for the next subarrays will be the suffix after the used subarray.
If we can match a group with multiple subarrays, we should choose the first one, as this will just leave the largest room for the next subarrays.