Find All Triplets Equal To Given Sum In An Array
Given an array and a given SUM, find all the triplets present in the array whose sum is equal to given SUM. Print all such triplets in the array.
For eg:
Let’s assume.
int arr[] = {5, 7, 9, 1, 6, 8};
int sum = 15;
Possible combinations are, {5, 9, 1}, {1, 6, 8}