Why does checking every subset solve the 0/1 knapsack perfectly, yet become hopeless at just 100 items?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Four items have values values = [60, 100, 120, 30], and the choice vector is V = [1, 0, 1, 1]. Compute the objective from the video, , so that each value is multiplied by its bit. You may find zip() and sum() useful. Assign the result to total_value.