Raquel is going on a really long trip, and will need many to…
Raquel is going on a really long trip, and will need many toys to be entertained. Prof. Brito allows her to use two bags, with capacities respectively. Design a Dynamic Programming algorithm for Raquel such that: given an array W and L for toys numbered , where W is the weight of toy i, and L is the liking coefficient for each toy (the higher L, the more she likes toy i), your algorithm outputs the maximum sum of the L values of both bags. For now, Raquel only has 1 of each toy. Example: W=, L=, , your algorithm should return 8=5+3 as a result of placing toy 2 in the second bag, and toy 4 in the first bag. Note that you can fill the second bag with toys 1 and 4, and place toy 3 in the first bag, but the sum of the L values in this case is 2+3+1=6