Back to problems

Payment Refund Allocation

Algorithm · Airbnb · Medium

Problem A financial services company is building a system to distribute customer refunds. You need to implement a function that takes a list of past transactions and a total refund amount, then allocates that refund across various customer payments according to a specific set of business rules. The input is a list of transactions, where each entry is a list of strings representing either a payment or a refund, formatted as follows: Payment: [ , "PAYMENT", , "", , ] Refund: […

Checking your access…