/**
 * A zoologist has collected data on the speed of various animals. The data is stored in a list of pairs,
 * where each pair contains the name of the animal and its speed in meters per second. The zoologist wants
 * to find the fastest animal in the list. Complete the code to find the fastest animal and return its name.
 *
 * @param animalList A list of pairs containing the name and speed of each animal.
 * @return The name of the fastest animal.
 */
fun findFastestAnimal(animalList: List<Pair<String, Int>>): String {

    var fastestSpeed = 0
    var fastestAnimal = ""

    for (animal in animalList) {
        if (animal.second > fastestSpeed) {
            fastestSpeed = animal.second
            fastestAnimal = animal.first
        }
    }

    return fastestAnimal
}
/**
 * A zoologist has collected data on the speed of various animals. The data is stored in a list of pairs,
 * where each pair contains the name of the animal and its speed in meters per second. The zoologist wants
 * to find the fastest animal in the list. Complete the code to find the fastest animal and return its name.
 *
 * @param animalList A list of pairs containing the name and speed of each animal.
 * @return The name of the fastest animal.
 */
fun findFastestAnimal(animalList: List<Pair<String, Int>>): String {
/**
 * A zoologist has collected data on the speed of various animals. The data is stored in a list of pairs,
 * where each pair contains the name of the animal and its speed in meters per second. The zoologist wants
 * to find the fastest animal in the list. Complete the code to find the fastest animal and return its name.
 *
 * @param animalList A list of pairs containing the name and speed of each animal.
 * @return The name of the fastest animal.
 */
fun findFastestAnimal(animalList: List<Pair<String, Int>>): String {

    var fastestSpeed = 0
    var fastestAnimal = ""

    for (animal in animalList) {
        if (animal.second > fastestSpeed) {
            fastestSpeed = animal.second
            fastestAnimal = animal.first
        }
    }

    return fastestAnimal
}