/**
 * Given an account balance (list of integers) and a transaction amount (integer),
 * update the account balance by adding the transaction amount to each element in the list.
 *
 * @param accountBalance A list of integers representing the current balance in the account.
 * @param transactionAmount An integer representing the amount to be added to each element.
 * @return The updated account balance after adding the transaction amount to each element.
 *
 * Example:
 * updateAccountBalance(listOf(100, 200, 300), 50) => [150, 250, 350]
 * updateAccountBalance(listOf(500, -200, 1000), -100) => [400, -300, 900]
 */
fun updateAccountBalance(accountBalance: MutableList<Int>, transactionAmount: Int): List<Int> {

    // Iterate through each element in the account balance list
    for (i in accountBalance.indices) {
        // Add the transaction amount to the current element
        accountBalance[i] += transactionAmount
    }
    // Return the updated account balance
    return accountBalance
}
/**
 * Given an account balance (list of integers) and a transaction amount (integer),
 * update the account balance by adding the transaction amount to each element in the list.
 *
 * @param accountBalance A list of integers representing the current balance in the account.
 * @param transactionAmount An integer representing the amount to be added to each element.
 * @return The updated account balance after adding the transaction amount to each element.
 *
 * Example:
 * updateAccountBalance(listOf(100, 200, 300), 50) => [150, 250, 350]
 * updateAccountBalance(listOf(500, -200, 1000), -100) => [400, -300, 900]
 */
fun updateAccountBalance(accountBalance: MutableList<Int>, transactionAmount: Int): List<Int> {
/**
 * Given an account balance (list of integers) and a transaction amount (integer),
 * update the account balance by adding the transaction amount to each element in the list.
 *
 * @param accountBalance A list of integers representing the current balance in the account.
 * @param transactionAmount An integer representing the amount to be added to each element.
 * @return The updated account balance after adding the transaction amount to each element.
 *
 * Example:
 * updateAccountBalance(listOf(100, 200, 300), 50) => [150, 250, 350]
 * updateAccountBalance(listOf(500, -200, 1000), -100) => [400, -300, 900]
 */
fun updateAccountBalance(accountBalance: MutableList<Int>, transactionAmount: Int): List<Int> {

    // Iterate through each element in the account balance list
    for (i in accountBalance.indices) {
        // Add the transaction amount to the current element
        accountBalance[i] += transactionAmount
    }
    // Return the updated account balance
    return accountBalance
}