Problem Statement:
Given an array of positive integers arr[] and an integer x, The task is to find all unique
combinations in arr[] where the sum is equal to x.
The same repeated number may be chosen from arr[] an unlimited number of times. Elements
in a combination (a1, a2, …, ak) must be printed in non-descending order. (ie, a1 <= a2 <= … <=
ak). If there is no combination possible print “Empty”.
Example:
Input:
arr[] = 2, 4, 6, 8, x = 8
2, 2, 2]2, 2, 4]2, 6]4, 4][8]
Output:
[2, 2, 2, 2]
[2, 2, 4]
[2, 6]
[4, 4]
[8]