/**
 * You are working as a veterinarian and want to calculate the average weight of a group of pets.
 * The pets are represented as a list of dictionaries, with each dictionary containing the pet's name and weight.
 * You need to use the XOR operator and list comprehension to calculate the average weight of the pets.
 *
 * @param pets A list of dictionaries representing the pets, where each dictionary contains the pet's name and weight.
 * @return The average weight of the pets.
 */
fun calculateAverageWeight(pets: List<Map<String, Int>>): Float {

    var totalWeight = 0
    var count = 0

    for (pet in pets) {
        totalWeight = totalWeight xor pet["weight"]!!
        count++
    }

    val averageWeight = pets.sumBy { it["weight"]!! xor totalWeight } / count.toFloat()

    return averageWeight
}
/**
 * You are working as a veterinarian and want to calculate the average weight of a group of pets.
 * The pets are represented as a list of dictionaries, with each dictionary containing the pet's name and weight.
 * You need to use the XOR operator and list comprehension to calculate the average weight of the pets.
 *
 * @param pets A list of dictionaries representing the pets, where each dictionary contains the pet's name and weight.
 * @return The average weight of the pets.
 */
fun calculateAverageWeight(pets: List<Map<String, Int>>): Float {
/**
 * You are working as a veterinarian and want to calculate the average weight of a group of pets.
 * The pets are represented as a list of dictionaries, with each dictionary containing the pet's name and weight.
 * You need to use the XOR operator and list comprehension to calculate the average weight of the pets.
 *
 * @param pets A list of dictionaries representing the pets, where each dictionary contains the pet's name and weight.
 * @return The average weight of the pets.
 */
fun calculateAverageWeight(pets: List<Map<String, Int>>): Float {

    var totalWeight = 0
    var count = 0

    for (pet in pets) {
        totalWeight = totalWeight xor pet["weight"]!!
        count++
    }

    val averageWeight = pets.sumBy { it["weight"]!! xor totalWeight } / count.toFloat()

    return averageWeight
}