Given an unsorted set of integers in the form of array, find all possible subsets whose sum is greater than k1 and less than k2 ,where k1 ,k2 are two floating constants, eg:- Our set is {2,3,5,8,10} and k1 =10 and k2 = 12.
Possible subsets:-
{2,3,5}
{8,2}
{8,3}
{10}
{10,2}
I can only think of a naive algorithm, is there any better method or similar problems ,please give some suggestions. It is actually an important part of my project work? Is there any dynamic programming method available ?