/**
 * This function takes in a dictionary of accounts and calculates the total expenses.
 *
 * @param accounts A dictionary where the keys represent the account names and the values represent the account values.
 * @return The sum of all the account values categorized as expenses.
 *
 * Example:
 * val accounts = mapOf("Utilities" to -200, "Rent" to -1000, "Salary" to 5000, "Supplies" to -300, "Travel" to -800)
 * calculateTotalExpenses(accounts) // -1300.0
 */
fun calculateTotalExpenses(accounts: Map<String, Int>): Double {

    var totalExpenses = 0.0

    for ((account, value) in accounts) {
        if (account.contains("Expense")) {
            totalExpenses += value
        }
    }

    return totalExpenses
}
/**
 * This function takes in a dictionary of accounts and calculates the total expenses.
 *
 * @param accounts A dictionary where the keys represent the account names and the values represent the account values.
 * @return The sum of all the account values categorized as expenses.
 *
 * Example:
 * val accounts = mapOf("Utilities" to -200, "Rent" to -1000, "Salary" to 5000, "Supplies" to -300, "Travel" to -800)
 * calculateTotalExpenses(accounts) // -1300.0
 */
fun calculateTotalExpenses(accounts: Map<String, Int>): Double {
/**
 * This function takes in a dictionary of accounts and calculates the total expenses.
 *
 * @param accounts A dictionary where the keys represent the account names and the values represent the account values.
 * @return The sum of all the account values categorized as expenses.
 *
 * Example:
 * val accounts = mapOf("Utilities" to -200, "Rent" to -1000, "Salary" to 5000, "Supplies" to -300, "Travel" to -800)
 * calculateTotalExpenses(accounts) // -1300.0
 */
fun calculateTotalExpenses(accounts: Map<String, Int>): Double {

    var totalExpenses = 0.0

    for ((account, value) in accounts) {
        if (account.contains("Expense")) {
            totalExpenses += value
        }
    }

    return totalExpenses
}