sizes = {25,50,60,120} maximum = 130
Your method will return 120 since all other combinations of components
either produce less code, or are greater than the 130 limit. If no
software can be built return -1(see last example).
tvector<int>, int
int
int biggest(const tvector<int>& sizes, int maximum)(be sure your method is public)
{25,50,60,120}
130
Returns: 120
This is the example from above.
{1,2,3,4,5}
15
Returns: 15
All of the code can be used
{20,40,45,60,60}
86
Returns: 85
Using 40 and 45 will produce the largest amount of code.
{89,73,20,5,5,10000,900}
995
Returns: 994
{122}
1
Returns: -1