algorithms.tutorialhorizon.com

Dynamic programming - Remove Boxes Problem | Algorithms

Given a number of boxes with different colors represented by different positive numbers. You need to remove all the boxes in several rounds, each time you can choose continuous boxes with the same color (means with same numbers, composed of k boxes, k >= 1), remove them and get k*k points. Write an algorithm to get the maximum points by removing all the boxes.