find all the combination of a specific sum in a array.
Anonymous
Opt(k, i) = Opt(k - a[i], i) U Opt(k, i-1) where : 1. Opt(k, i) is the ways to get sum = k for subarrray a[0:i] 2. Sum(Positive Elements) <= k <= Sum(Negative Elements)
Check out your Company Bowl for anonymous work chats.