/**
 * Given a list of account balances and a transaction amount, this function adds the transaction amount to each balance
 * in the list and returns the updated balances.
 *
 * @param balances a list of integers representing the account balances
 * @param transaction an integer representing the transaction amount
 * @return updatedBalances a list of integers representing the updated account balances after adding the transaction amount
 */
fun sumAndUpdateBalance(balances: MutableList<Int>, transaction: Int): List<Int> {

    // Loop through each balance and update it by adding the transaction amount
    for (i in balances.indices) {
        balances[i] += transaction
    }
    return balances
}
/**
 * Given a list of account balances and a transaction amount, this function adds the transaction amount to each balance
 * in the list and returns the updated balances.
 *
 * @param balances a list of integers representing the account balances
 * @param transaction an integer representing the transaction amount
 * @return updatedBalances a list of integers representing the updated account balances after adding the transaction amount
 */
fun sumAndUpdateBalance(balances: MutableList<Int>, transaction: Int): List<Int> {
/**
 * Given a list of account balances and a transaction amount, this function adds the transaction amount to each balance
 * in the list and returns the updated balances.
 *
 * @param balances a list of integers representing the account balances
 * @param transaction an integer representing the transaction amount
 * @return updatedBalances a list of integers representing the updated account balances after adding the transaction amount
 */
fun sumAndUpdateBalance(balances: MutableList<Int>, transaction: Int): List<Int> {

    // Loop through each balance and update it by adding the transaction amount
    for (i in balances.indices) {
        balances[i] += transaction
    }
    return balances
}