Search
⌘K

Leetcode 2944. Minimum Number of Coins for Fruits

Given prices where buying the (i+1)-th fruit at prices[i] coins grants you up to the next i fruits for free, choose which fruits to purchase to obtain all fruits at minimum total cost. This is a prefix-coverage minimization problem solvable with dynamic programming that picks purchases that jump coverage forward at minimal sum.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.