/**
 * You are a Marketing Manager and need to calculate the total sales after considering returns.
 *
 * Write a function that takes two lists as arguments:
 * 1. salesData - a list of integers representing the amount of sales made on each day.
 * 2. returnData - a list of integers representing the amount of returns made on each day.
 *
 * Your task is to calculate the total net sales by deducting the returns from the sales.
 *
 * For example, if salesData = [100, 200, 50, 300] and returnData = [10, 50, 20, 100],
 * then the net sales would be (100 - 10) + (200 - 50) + (50 - 20) + (300 - 100) = 470.
 *
 * Your function should return the net sales as an integer.
 */
fun calculateSalesReturns(salesData: List<Int>, returnData: List<Int>): Int {

    var netSales = 0

    // Loop through the salesData and returnData simultaneously using the 'zip' function
    for ((sales, returns) in salesData.zip(returnData)) {
        // Subtract returns from sales and add it to netSales
        netSales += sales - returns
    }

    return netSales
}
/**
 * You are a Marketing Manager and need to calculate the total sales after considering returns.
 *
 * Write a function that takes two lists as arguments:
 * 1. salesData - a list of integers representing the amount of sales made on each day.
 * 2. returnData - a list of integers representing the amount of returns made on each day.
 *
 * Your task is to calculate the total net sales by deducting the returns from the sales.
 *
 * For example, if salesData = [100, 200, 50, 300] and returnData = [10, 50, 20, 100],
 * then the net sales would be (100 - 10) + (200 - 50) + (50 - 20) + (300 - 100) = 470.
 *
 * Your function should return the net sales as an integer.
 */
fun calculateSalesReturns(salesData: List<Int>, returnData: List<Int>): Int {
/**
 * You are a Marketing Manager and need to calculate the total sales after considering returns.
 *
 * Write a function that takes two lists as arguments:
 * 1. salesData - a list of integers representing the amount of sales made on each day.
 * 2. returnData - a list of integers representing the amount of returns made on each day.
 *
 * Your task is to calculate the total net sales by deducting the returns from the sales.
 *
 * For example, if salesData = [100, 200, 50, 300] and returnData = [10, 50, 20, 100],
 * then the net sales would be (100 - 10) + (200 - 50) + (50 - 20) + (300 - 100) = 470.
 *
 * Your function should return the net sales as an integer.
 */
fun calculateSalesReturns(salesData: List<Int>, returnData: List<Int>): Int {

    var netSales = 0

    // Loop through the salesData and returnData simultaneously using the 'zip' function
    for ((sales, returns) in salesData.zip(returnData)) {
        // Subtract returns from sales and add it to netSales
        netSales += sales - returns
    }

    return netSales
}