Imagine I have a list of integers $l=\{l_1,l_2,...,l_{50}\}$, say, for example
l = RandomInteger[10, 50]
and I want to find how many ways there are of summing numbers from that list such that the sum is a given number $K$. In other words, I'm looking for all the possible combinations of coefficients $\{x_1,...,x_{50}\}$ such that $$ \sum_{i=1}^{50} x_i l_i=K $$ where $x_i\in\{0,1\}$. I suppose this could be a very demanding calculation, but I wonder if there is a good or efficient way of finding these combinations and listing them.