Google interview question

Two leetcode questions that solve variations the knapsack problems