There are multiple bank accounts with some initial balances. You need to process a list of bank requests in the order they are received. The requests can be deposits, withdrawals, or transfers between accounts.
A deposit adds money to an account.
A withdrawal should only be processed if the account has enough balance. Every successful withdrawal earns a 2% cashback (rounded down), which is credited exactly 24 hours later.
A transfer moves money from one account to another. The transfer should fail if either account doesn't exist, there isn't enough balance in the sender's account, or the sender and receiver are the same account.
If a cashback becomes due at the exact same timestamp as another request, the cashback should be applied before processing that request.
If any request is invalid, stop processing immediately and return the negative index (1-based) of that request. Otherwise, process all the requests and return the final account balances. Any cashback that is still pending after the last request should be ignored.
def process_bank_requests(accounts, requests):