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
3 rows with columns account_id, txn_id, amount, balance_before
Run your code to see the output here.