I want Chocolate
CodeChefOpen on judge ↗
Give me Chocolate Anushka wants to buy chocolates.there are many chocolates in front of her, tagged with their prices. Anushka has only a certain amount to spend, and she wants to maximize the number of chocolates she buys with this money. Given a list of prices and an amount to spend, what is the maximum number of chocolates Anushka can buy? For example, if prices =[1,2,3,4] and Anushka
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.
Sign in to chat with the tutor and save your progress.
Sign in to start