Cut the dead branch.
transcript
Twenty-two prices make a huge list. A box must cost exactly 50. Do you check every subset?
Checking every subset takes 4,194,303 checks. A pruned search needs only 488 calls. Both find the same 75 boxes.
Add one price at a time. Stop when the total passes the budget. Never extend a set that is over. Every extension of it is over too.
Sort the prices from small to large. One price too large cuts every later price. So the loop stops at once.
The answer does not change. Only the number of calls does. The counter measured it.
Prices two, three, five and six. The budget is eight. The search makes nine calls, not thirty-one.
A prune must be safe. Cut a branch only if no answer lies inside. A wrong cut loses boxes without any error. Measure the calls that survive.
Prune before you choose. Skip what cannot work. Full breakdown in the lecture.