👉 In the context of computer science, a knapsack problem is a type of optimization problem where you are given a set of items and a capacity for a knapsack that can hold any number of these items. The goal is to find the optimal way to fill the knapsack with the maximum number of items while ensuring that each item has a non-negative weight. For example, if we have a knapsack of size 3 and the items are all apples (weight = 2