/**
 * This function takes a list of temperatures and calculates the average temperature.
 * It then applies the unconditioned ternary operator and combines it with a for loop to find the maximum
 * and minimum temperature in the list. The exercise is designed to test the historian's understanding of
 * advanced Python concepts.
 */
fun calculateAverageTemperature(temperatures: List<Int>): Triple<Double, Int, Int> {

    val averageTemp = temperatures.sum().toDouble() / temperatures.size

    var maxTemp = Int.MIN_VALUE
    var minTemp = Int.MAX_VALUE

    for (temp in temperatures) {
        maxTemp = if (temp > maxTemp) temp else maxTemp
        minTemp = if (temp < minTemp) temp else minTemp
    }

    return Triple(averageTemp, maxTemp, minTemp)
}

// Example usage:
/**
 * This function takes a list of temperatures and calculates the average temperature.
 * It then applies the unconditioned ternary operator and combines it with a for loop to find the maximum
 * and minimum temperature in the list. The exercise is designed to test the historian's understanding of
 * advanced Python concepts.
 */
fun calculateAverageTemperature(temperatures: List<Int>): Triple<Double, Int, Int> {
/**
 * This function takes a list of temperatures and calculates the average temperature.
 * It then applies the unconditioned ternary operator and combines it with a for loop to find the maximum
 * and minimum temperature in the list. The exercise is designed to test the historian's understanding of
 * advanced Python concepts.
 */
fun calculateAverageTemperature(temperatures: List<Int>): Triple<Double, Int, Int> {

    val averageTemp = temperatures.sum().toDouble() / temperatures.size

    var maxTemp = Int.MIN_VALUE
    var minTemp = Int.MAX_VALUE

    for (temp in temperatures) {
        maxTemp = if (temp > maxTemp) temp else maxTemp
        minTemp = if (temp < minTemp) temp else minTemp
    }

    return Triple(averageTemp, maxTemp, minTemp)
}

// Example usage: