/**
 * Given a list of temperatures (in degrees Celsius), calculate and return the average temperature.
 *
 * Use a basic for loop and the AND operator to solve this exercise.
 */
fun calculateAverageTemperature(temperatures: List<Int>): Pair<Double, Int> {

    var sum = 0
    var count = 0

    for (temperature in temperatures) {
        sum += temperature
        // Implement the AND operator here to check if temperature is between 20 and 30 degrees Celsius
        if (temperature >= 20 && temperature <= 30) {
            count++
        }
    }

    // Calculate the average temperature
    val averageTemperature = sum.toDouble() / temperatures.size

    return Pair(averageTemperature, count)
}
/**
 * Given a list of temperatures (in degrees Celsius), calculate and return the average temperature.
 *
 * Use a basic for loop and the AND operator to solve this exercise.
 */
fun calculateAverageTemperature(temperatures: List<Int>): Pair<Double, Int> {
/**
 * Given a list of temperatures (in degrees Celsius), calculate and return the average temperature.
 *
 * Use a basic for loop and the AND operator to solve this exercise.
 */
fun calculateAverageTemperature(temperatures: List<Int>): Pair<Double, Int> {

    var sum = 0
    var count = 0

    for (temperature in temperatures) {
        sum += temperature
        // Implement the AND operator here to check if temperature is between 20 and 30 degrees Celsius
        if (temperature >= 20 && temperature <= 30) {
            count++
        }
    }

    // Calculate the average temperature
    val averageTemperature = sum.toDouble() / temperatures.size

    return Pair(averageTemperature, count)
}