Implement `knapsack(weights, values, capacity)` returning the maximum total value of items that fit, where each item can be taken at most once.
+ 1 hidden test run on Submit.
A 1D DP filled from high capacity down keeps each item once. O(n * capacity) time.
Run your code to see results.