I have set of numbers; example: [12, 13, 15, 18]. From which I have to find the elements whose sum is a specific "total value", for example: 25 is 12 + 13.
Edit: First of all thank you all for your valuable feedback but i think many of you misunderstood my question! My question is not just for "two combination" but for more than two. For example:
1 2 3 4 5 6 7 8 9 10 100
From the above list we need to get "119" here we need more than "two combination".
How can i write the code through bash script or JavaScript?
Kindly help.