Your question is Transaction Totals Per Minute. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Ramp needs a chronological minute-by-minute summary of card transaction activity. Given a list of Ramp card transactions, return the total amount for every minute from the earliest transaction minute through the latest transaction minute, including minutes with no transactions.
Implement aggregate_minute_totals(transactions). Each transaction is a dictionary with:
timestamp: a non-negative Unix timestamp in secondsamount: an integer amount in centsReturn a list of integer totals in chronological minute order. A transaction belongs to minute timestamp // 60. The output starts at the minute containing the earliest transaction and ends at the minute containing the latest transaction, both inclusive. Preserve zero totals for empty minutes. The input order is arbitrary.
def aggregate_minute_totals(transactions):