You are given S,X and N.
S = size of an array
N = number of elements you have to find
X = sum
You have to find N elements from the array which sum is X.
Input:
7 25 3
1 5 10 7 13 15
Output:
5 7 13
If there are multiple solution you can output any of them. What are the best possible solutions with least complexity for this problem?