BIGARRAY - Editorial

For the above test case N = 10, S = 15. The total possible sum could be 55 ((10 * 11) / 2). To get a target sum of 15 we need to remove exactly 40. But the value 40 is not in the range of 1 <= N <= 10. Therefore the answer for the above test case is -1.