/**
 * Given a list of pets, find the pet with the heaviest weight.
 *
 * @param pets A list of pairs representing the name and weight of each pet.
 * @return A pair containing the name and weight of the heaviest pet.
 */
fun findHeaviestPet(pets: List<Pair<String, Int>>): Pair<String, Int> {

    val maxWeight = pets.maxByOrNull { it.second }?.second
    return pets.firstOrNull { it.second == maxWeight } ?: throw NoSuchElementException("No pets found")
}
/**
 * Given a list of pets, find the pet with the heaviest weight.
 *
 * @param pets A list of pairs representing the name and weight of each pet.
 * @return A pair containing the name and weight of the heaviest pet.
 */
fun findHeaviestPet(pets: List<Pair<String, Int>>): Pair<String, Int> {
/**
 * Given a list of pets, find the pet with the heaviest weight.
 *
 * @param pets A list of pairs representing the name and weight of each pet.
 * @return A pair containing the name and weight of the heaviest pet.
 */
fun findHeaviestPet(pets: List<Pair<String, Int>>): Pair<String, Int> {

    val maxWeight = pets.maxByOrNull { it.second }?.second
    return pets.firstOrNull { it.second == maxWeight } ?: throw NoSuchElementException("No pets found")
}