Test HN: need a simple answer
Here is the brief summary in his words:
Probably not interesting to most people but I've again I've just underestimated an algorithm I thought would be very simple ...
I get paid a weekly total for many small daily jobs. All is well if I get paid for everything but if I don't then which jobs haven't I been paid for?
i.e. last week I was paid only paid £153.00 for the following list of [potential] jobs £24.10,£45.40,£21.30,£7.55,£24.90,£24.50,£7.45,£1.25,£9.60,£30.00,£17.20,£21.05,£7.40,24.10,£9.35,£14.65,£4.25
Which payments am I missing?
My first answer was that there is approx. 130,000 (interesting anecdote: Wolfram Alpha was a bitch to get working on complex combinations, I did by hand in the end :D) combinations of the payments. So just compute, store in Sqlite/Mysql and then query for the total you get each week to retrieve the list of payments.
But I cant help feeling there must be a nicer way (i.e. one that means adding a new payment doest mean you need to reprocess). Maths is not my strongest focus.... so, HN, am I missing the obvious?