Show account_id, txn_id, amount and rn: the row number by amount within each account, largest = 1 (ties by smaller txn_id).
account_id
txn_id
amount
rn
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.