/**
 * A zoologist needs your help to remove a specific animal from a list.
 *
 * You have been given a list of animals, and given the name of an animal that needs to be removed.
 * Your task is to write a function that takes in the list of animals and the name of the animal to remove,
 * and removes all occurrences of that animal from the list.
 *
 * @param animals A list of animals.
 * @param animalName The name of the animal to remove.
 * @return The updated list of animals after removing all occurrences of the specified animal.
 *
 * Example:
 * removeAnimalFromList(listOf("lion", "tiger", "elephant", "tiger", "monkey"), "tiger")
 * Output: ["lion", "elephant", "monkey"]
 */
fun removeAnimalFromList(animals: MutableList<String>, animalName: String): List<String> {

    while (animalName in animals) {
        animals.remove(animalName)
    }
    return animals
}
/**
 * A zoologist needs your help to remove a specific animal from a list.
 *
 * You have been given a list of animals, and given the name of an animal that needs to be removed.
 * Your task is to write a function that takes in the list of animals and the name of the animal to remove,
 * and removes all occurrences of that animal from the list.
 *
 * @param animals A list of animals.
 * @param animalName The name of the animal to remove.
 * @return The updated list of animals after removing all occurrences of the specified animal.
 *
 * Example:
 * removeAnimalFromList(listOf("lion", "tiger", "elephant", "tiger", "monkey"), "tiger")
 * Output: ["lion", "elephant", "monkey"]
 */
fun removeAnimalFromList(animals: MutableList<String>, animalName: String): List<String> {
/**
 * A zoologist needs your help to remove a specific animal from a list.
 *
 * You have been given a list of animals, and given the name of an animal that needs to be removed.
 * Your task is to write a function that takes in the list of animals and the name of the animal to remove,
 * and removes all occurrences of that animal from the list.
 *
 * @param animals A list of animals.
 * @param animalName The name of the animal to remove.
 * @return The updated list of animals after removing all occurrences of the specified animal.
 *
 * Example:
 * removeAnimalFromList(listOf("lion", "tiger", "elephant", "tiger", "monkey"), "tiger")
 * Output: ["lion", "elephant", "monkey"]
 */
fun removeAnimalFromList(animals: MutableList<String>, animalName: String): List<String> {

    while (animalName in animals) {
        animals.remove(animalName)
    }
    return animals
}