Probably best explained using an example... Imagine having a client with 15 outstanding invoices, and one day they provide you with a cheque, but do not tell you which invoices it is for. This code will look at all the combinations (one value per line), and tell you which of the invoices could have been paid (matching the goal).
If your interested, you can view the code.
As this is a brute force approach, I've limited it to 10 numbers if you don't specify a goal (it prints out all calculations done), and 15 numbers if you do specify a goal (any more will take too long to process).