You are having a party and want to order cakes for your guests from a nearby Eatery. The Eatery has enough different types of cakes to faciliatate your guests. But there are some conditions to it
You estimated the maximum number of slices that you want to order for your guests based on the number of registered guests list. In order to reduce food waste, your goal is to order as many slices as possible, but not more than the maximum number.
You are provided with two Strings S1 and S2, where
Your solution should return an array of integer stating the number of cakes that we can select to order which are less than or equal to the maximum number of slices that we need. In this case, it should return {2, 6, 8}
Limits
Note: Kindly consider the limits before suggesting knapsack as a solution