/**
 * Takes a list of expenses and a category as input and returns the total amount spent in that category.
 * Assumes each expense is a tuple of the form (category, amount).
 *
 * @param expenses a list of tuples representing expenses
 * @param category a string representing the category of expenses to calculate the total for
 * @return total a float representing the total amount spent in the specified category
 */
fun calculateTotalExpenses(expenses: List<Pair<String, Double>>, category: String): Double {

    var total = 0.0

    for (expense in expenses) {
        if (expense.first == category) {
            total += expense.second
        }
    }

    return total
}
/**
 * Takes a list of expenses and a category as input and returns the total amount spent in that category.
 * Assumes each expense is a tuple of the form (category, amount).
 *
 * @param expenses a list of tuples representing expenses
 * @param category a string representing the category of expenses to calculate the total for
 * @return total a float representing the total amount spent in the specified category
 */
fun calculateTotalExpenses(expenses: List<Pair<String, Double>>, category: String): Double {
/**
 * Takes a list of expenses and a category as input and returns the total amount spent in that category.
 * Assumes each expense is a tuple of the form (category, amount).
 *
 * @param expenses a list of tuples representing expenses
 * @param category a string representing the category of expenses to calculate the total for
 * @return total a float representing the total amount spent in the specified category
 */
fun calculateTotalExpenses(expenses: List<Pair<String, Double>>, category: String): Double {

    var total = 0.0

    for (expense in expenses) {
        if (expense.first == category) {
            total += expense.second
        }
    }

    return total
}