0Pricing
Competitive Programming Academy · Lesson

0/1 Knapsack: Take or Leave

Maximize value under a weight cap.

The Knapsack Story

You have a bag with a weight limit and a pile of items. The 0/1 knapsack asks: which items maximize value without overpacking? 🎒

Take or Leave

The word 0/1 means each item is either fully taken or fully skipped. You can never grab half an item, so every choice is yes or no.

All lessons in this course

  1. 0/1 Knapsack: Take or Leave
  2. Space-Optimized Knapsack
  3. Unbounded & Coin-Change DP
  4. Subset Sum & Partition
← Back to Competitive Programming Academy