Minimum Cost to Merge Stones
Repeatedly merge exactly k neighbouring piles into one pile, paying their combined size each time, and find the lowest total cost to reach a single pile. An interval table shows which contiguous ranges can be collapsed.
Repeatedly merge exactly k neighbouring piles into one pile, paying their combined size each time, and find the lowest total cost to reach a single pile. An interval table shows which contiguous ranges can be collapsed.