In bank account I have values that can be the sum of one or more clients payments.
I Need to make a report with these individuals payments and check if there is a sum of some of this payments that matches the amount in a bank accounts report.
I'm using the itertools.permutatons
, with the approach exposed here Text It appears to be working, except when the list of values exceeds 11 itens. It takes forever and doesn't finish the eval
. Any other solution for this? I need to perform only sums evaluations.
In short i need to find which combinations of this values (if any)
[1001.0, 1000.0, 1598.0, 2000.0, 2000.0, 900.0, 900.0, 2350.0, 6200.0, 600.0, 390.0, 759.0, 1798.0, 2740.0, 1061.0, 978.0, 2750.0, 2825.0, 660.0, 887.0, 1710.0, 6368.0, 1475.0, 2700.0]
matches 36706.0
, for example. Looks like permutations generates too many combinations in this case so takes a eternity to finish.