Design a simple banking system that supports creating customer accounts, depositing money, and transferring funds between accounts. Each operation is timestamped with increasing integer times to simulate a real-time system.
Implement the BankingSystem class:
-
BankingSystem()Initializes the banking system with no accounts. -
boolean createAccount(int timestamp, String accountId)Creates a new account identified byaccountIdwith a zero balance.- Returns
trueif the account is created successfully. - Returns
falseif an account with the sameaccountIdalready exists.
- Returns
-
int deposit(int timestamp, String accountId, int amount)Addsamountto the balance of the existing accountaccountId.- Returns the new balance if the account exists.
- Returns
-1ifaccountIddoes not exist.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected