/**
 * This function calculates the average temperature for each month given a list of measurements.
 *
 * @param months List of month names.
 * @param measurements List of lists containing temperature measurements for each month.
 * @return A dictionary where the keys are the month names and the values are the average temperatures.
 */
fun calculateAverageTemperature(months: List<String>, measurements: List<List<Double>>): Map<String, Double> {

    val averageTemperatures = mutableMapOf<String, Double>()  // Initializing an empty dictionary for storing average temperatures

    // Iterate over each month
    for (i in months.indices) {
        var totalTemperature = 0.0  // Initializing a variable to store the total temperature for each month

        // Iterate over each measurement for the current month
        for (temperature in measurements[i]) {
            totalTemperature += temperature  // Accumulating the temperature
        }

        val averageTemperature = totalTemperature / measurements[i].size  // Calculating the average temperature
        averageTemperatures[months[i]] = averageTemperature  // Adding the average temperature to the dictionary
    }

    return averageTemperatures
}
/**
 * This function calculates the average temperature for each month given a list of measurements.
 *
 * @param months List of month names.
 * @param measurements List of lists containing temperature measurements for each month.
 * @return A dictionary where the keys are the month names and the values are the average temperatures.
 */
fun calculateAverageTemperature(months: List<String>, measurements: List<List<Double>>): Map<String, Double> {
/**
 * This function calculates the average temperature for each month given a list of measurements.
 *
 * @param months List of month names.
 * @param measurements List of lists containing temperature measurements for each month.
 * @return A dictionary where the keys are the month names and the values are the average temperatures.
 */
fun calculateAverageTemperature(months: List<String>, measurements: List<List<Double>>): Map<String, Double> {

    val averageTemperatures = mutableMapOf<String, Double>()  // Initializing an empty dictionary for storing average temperatures

    // Iterate over each month
    for (i in months.indices) {
        var totalTemperature = 0.0  // Initializing a variable to store the total temperature for each month

        // Iterate over each measurement for the current month
        for (temperature in measurements[i]) {
            totalTemperature += temperature  // Accumulating the temperature
        }

        val averageTemperature = totalTemperature / measurements[i].size  // Calculating the average temperature
        averageTemperatures[months[i]] = averageTemperature  // Adding the average temperature to the dictionary
    }

    return averageTemperatures
}