/**
 * Write a function that takes in two parameters: accountBalance (a list representing the balance of each account)
 * and expenses (a map representing the expenses per category).
 *
 * The function should calculate and return the total profit of the accountant by subtracting the sum of expenses
 * from the sum of account balances.
 *
 * Example:
 * val accountBalance = listOf(15000, 25000, 12000, 5000)
 * val expenses = mapOf("utilities" to 2500, "rent" to 3000, "office supplies" to 1500, "salaries" to 8000)
 *
 * get_total_profit(accountBalance, expenses)
 * > Expected output: 58000
 *
 * Your task is to complete the code to solve the exercise.
 */
fun getTotalProfit(accountBalance: List<Int>, expenses: Map<String, Int>): Int {

    val totalAccountBalance = accountBalance.sum()
    val totalExpenses = expenses.values.sum()

    return totalAccountBalance - totalExpenses
}
/**
 * Write a function that takes in two parameters: accountBalance (a list representing the balance of each account)
 * and expenses (a map representing the expenses per category).
 *
 * The function should calculate and return the total profit of the accountant by subtracting the sum of expenses
 * from the sum of account balances.
 *
 * Example:
 * val accountBalance = listOf(15000, 25000, 12000, 5000)
 * val expenses = mapOf("utilities" to 2500, "rent" to 3000, "office supplies" to 1500, "salaries" to 8000)
 *
 * get_total_profit(accountBalance, expenses)
 * > Expected output: 58000
 *
 * Your task is to complete the code to solve the exercise.
 */
fun getTotalProfit(accountBalance: List<Int>, expenses: Map<String, Int>): Int {
/**
 * Write a function that takes in two parameters: accountBalance (a list representing the balance of each account)
 * and expenses (a map representing the expenses per category).
 *
 * The function should calculate and return the total profit of the accountant by subtracting the sum of expenses
 * from the sum of account balances.
 *
 * Example:
 * val accountBalance = listOf(15000, 25000, 12000, 5000)
 * val expenses = mapOf("utilities" to 2500, "rent" to 3000, "office supplies" to 1500, "salaries" to 8000)
 *
 * get_total_profit(accountBalance, expenses)
 * > Expected output: 58000
 *
 * Your task is to complete the code to solve the exercise.
 */
fun getTotalProfit(accountBalance: List<Int>, expenses: Map<String, Int>): Int {

    val totalAccountBalance = accountBalance.sum()
    val totalExpenses = expenses.values.sum()

    return totalAccountBalance - totalExpenses
}