/**
 * Calculate the total expenses from the given transactionData.
 *
 * The transactionData is a list of pairs. Each pair contains the transaction date and the expense amount.
 *
 * @param transactionData List of pairs representing transaction date and expense amount
 * @return Total expenses
 *
 * Example:
 * calculateTotalExpenses(listOf(Pair("2021-01-01", 100), Pair("2021-01-02", 50), Pair("2021-01-03", 75)))
 * Returns:
 * 225
 */
fun calculateTotalExpenses(transactionData: List<Pair<String, Int>>): Int {

    var totalExpenses = 0

    // Loop through each pair in the transactionData
    for (transaction in transactionData) {
        // Unpack the pair into variables
        val date = transaction.first
        val expense = transaction.second

        // Add the expense to the totalExpenses
        totalExpenses += expense
    }

    return totalExpenses
}
/**
 * Calculate the total expenses from the given transactionData.
 *
 * The transactionData is a list of pairs. Each pair contains the transaction date and the expense amount.
 *
 * @param transactionData List of pairs representing transaction date and expense amount
 * @return Total expenses
 *
 * Example:
 * calculateTotalExpenses(listOf(Pair("2021-01-01", 100), Pair("2021-01-02", 50), Pair("2021-01-03", 75)))
 * Returns:
 * 225
 */
fun calculateTotalExpenses(transactionData: List<Pair<String, Int>>): Int {
/**
 * Calculate the total expenses from the given transactionData.
 *
 * The transactionData is a list of pairs. Each pair contains the transaction date and the expense amount.
 *
 * @param transactionData List of pairs representing transaction date and expense amount
 * @return Total expenses
 *
 * Example:
 * calculateTotalExpenses(listOf(Pair("2021-01-01", 100), Pair("2021-01-02", 50), Pair("2021-01-03", 75)))
 * Returns:
 * 225
 */
fun calculateTotalExpenses(transactionData: List<Pair<String, Int>>): Int {

    var totalExpenses = 0

    // Loop through each pair in the transactionData
    for (transaction in transactionData) {
        // Unpack the pair into variables
        val date = transaction.first
        val expense = transaction.second

        // Add the expense to the totalExpenses
        totalExpenses += expense
    }

    return totalExpenses
}