← All problemsSign in

Maximization Problem

Alice wants to buy different gift items. There are a number of different gift items lying in front of him, tagged with their prices. Alice has only a certain amount to spend, and he wants to maximize the number of gifts he buys with this money. Given a list of gift item prices and an amount to spend, determine the maximum number of gifts he can buy. Note Each gift item can be purchased only onc

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