Adyen interview question

Solve a knapsack problem with finite and prioritized elements