For each account, find the largest debit and the balance just before it. Return account_id, txn_id, amount and balance_before.
account_id
txn_id
amount
balance_before
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.