Problem 3469 · Medium

Find Minimum Cost to Remove Array Elements

Each step removes two of the first three elements at the cost of the larger one, so a memoized search over the remaining front and position finds the cheapest plan.

Open the interactive visualisation