Saved Bookmarks
| 1. |
Given an array and a number x find the set of numbers whose sum is less than x but closest to it. |
|
Answer» If the array is 1,4,7.... and the number is 100 we have to find sum of 1,4,7... just SHORT of 100. For an A.P. sum is 0.5*n*(2*a+(n-1)*d). With a equals 1 and d=3 putting the equation = 100 gives n a LITTLE above 8 so n=8 and sum of series with 8 TERMS 92. |
|