/**
 * This function takes a list of years and a 2D list of temperature data for each year.
 * It calculates the average temperature for each year and returns a list of average temperatures.
 * The temperature data must be in Celsius.
 */
fun calculateAverageTemperature(years: List<Int>, data: List<List<Double>>): List<Double> {

    val averageTemperatures = mutableListOf<Double>()
    
    for (i in data.indices) {
        var sumTemperatures = 0.0
        for (temperature in data[i]) {
            sumTemperatures += temperature
        }
        averageTemperatures.add(sumTemperatures / data[i].size)
    }
    
    return averageTemperatures
}
/**
 * This function takes a list of years and a 2D list of temperature data for each year.
 * It calculates the average temperature for each year and returns a list of average temperatures.
 * The temperature data must be in Celsius.
 */
fun calculateAverageTemperature(years: List<Int>, data: List<List<Double>>): List<Double> {
/**
 * This function takes a list of years and a 2D list of temperature data for each year.
 * It calculates the average temperature for each year and returns a list of average temperatures.
 * The temperature data must be in Celsius.
 */
fun calculateAverageTemperature(years: List<Int>, data: List<List<Double>>): List<Double> {

    val averageTemperatures = mutableListOf<Double>()
    
    for (i in data.indices) {
        var sumTemperatures = 0.0
        for (temperature in data[i]) {
            sumTemperatures += temperature
        }
        averageTemperatures.add(sumTemperatures / data[i].size)
    }
    
    return averageTemperatures
}