← All problemsSign in

1774. Closest Dessert Cost

LeetCodeArrayDynamic ProgrammingBacktrackingOpen on judge ↗

You would like to make dessert and are preparing to buy the ingredients. You have n ice cream base flavors and m types of toppings to choose from. You must follow these rules when making your dessert: - There must be exactly one ice cream base. - You can add one or more types of topping or have no toppings at all. - There are at most two of each type of topping. You are given three inputs: -

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start