/**
 * Calculate the total profit for an accountant.
 *
 * @param expenses A list of expenses.
 * @param sales A list of sales.
 * @return Total profit calculated as the sum of sales minus expenses.
 */
fun calculateTotalProfit(expenses: List<Double>, sales: List<Double>): Double {

    var totalProfit = 0.0

    // Iterate over the range of the smallest list between expenses and sales
    for (i in 0 until minOf(expenses.size, sales.size)) {
        // Calculate the profit for each transaction
        val transactionProfit = sales[i] - expenses[i]

        // Accumulate the profit to the totalProfit variable
        totalProfit += transactionProfit
    }

    return totalProfit
}
/**
 * Calculate the total profit for an accountant.
 *
 * @param expenses A list of expenses.
 * @param sales A list of sales.
 * @return Total profit calculated as the sum of sales minus expenses.
 */
fun calculateTotalProfit(expenses: List<Double>, sales: List<Double>): Double {
/**
 * Calculate the total profit for an accountant.
 *
 * @param expenses A list of expenses.
 * @param sales A list of sales.
 * @return Total profit calculated as the sum of sales minus expenses.
 */
fun calculateTotalProfit(expenses: List<Double>, sales: List<Double>): Double {

    var totalProfit = 0.0

    // Iterate over the range of the smallest list between expenses and sales
    for (i in 0 until minOf(expenses.size, sales.size)) {
        // Calculate the profit for each transaction
        val transactionProfit = sales[i] - expenses[i]

        // Accumulate the profit to the totalProfit variable
        totalProfit += transactionProfit
    }

    return totalProfit
}