Knapsack Problem Leetcode Question 5