Neural Ninjas ยท DSA Simulation Labs ยท Lab 48

๐ŸŽ’ The Knapsack Grid

Rows are items, columns are capacity. Every cell asks one question: is skipping this item (look straight UP) better than taking it (look UP and LEFT by its weight, plus its value)? Whichever is bigger wins that cell โ€” the whole table fills from that one rule.

Fill Log

Controls

๐Ÿ”ฒ Grid CellI only ever look at two cells that already exist: straight up (skip this item), and up-and-left by the item's weight (take it). I take the bigger one.
๐Ÿ“ฆ ItemI have a weight and a value, fixed. Every row belongs to me โ€” I get considered exactly once per capacity column.
Pick a level above to begin.