Find out which combinations of numbers in a set add up to a given total

后端 未结 8 1130
旧时难觅i
旧时难觅i 2020-12-01 08:11

I\'ve been tasked with helping some accountants solve a common problem they have - given a list of transactions and a total deposit, which transactions are part of the depos

8条回答
  •  离开以前
    2020-12-01 08:45

    Depending on your data you could first look at the cents portion of each transaction. Like in your initial example you know that 2.50 has to be part of the total because it is the only set of non-zero cent transactions which add to 50.

提交回复
热议问题