Knapsack 0/1 Optimization

In a world where rare artifacts are highly prized, a renowned collector is seeking to assemble a collection of valuable relics within a limited storage space. The collector has a variety of artifacts to choose from, each with its own unique value and size. The goal is to select a subset of these artifacts such that their total value is maximized without exceeding the available storage capacity.

Examples
Input: [[1,2,3],[10,15,40],5]
Output: 55
Hints

Knapsack 0/1 Optimization

In a world where rare artifacts are highly prized, a renowned collector is seeking to assemble a collection of valuable relics within a limited storage space. The collector has a variety of artifacts to choose from, each with its own unique value and size. The goal is to select a subset of these artifacts such that their total value is maximized without exceeding the available storage capacity.