/**
 * This function replaces all occurrences of the current animal with the new animal in the given animal list.
 *
 * @param animalList A list of animals.
 * @param currentAnimal The animal to be replaced.
 * @param newAnimal The animal to be used as replacement.
 * @return A new list with all occurrences of the current animal replaced with the new animal.
 */
fun replaceWithNone(animalList: List<String>, currentAnimal: String, newAnimal: String): List<String> {

    return animalList.map { if (it == currentAnimal) newAnimal else it }
}
/**
 * This function replaces all occurrences of the current animal with the new animal in the given animal list.
 *
 * @param animalList A list of animals.
 * @param currentAnimal The animal to be replaced.
 * @param newAnimal The animal to be used as replacement.
 * @return A new list with all occurrences of the current animal replaced with the new animal.
 */
fun replaceWithNone(animalList: List<String>, currentAnimal: String, newAnimal: String): List<String> {
/**
 * This function replaces all occurrences of the current animal with the new animal in the given animal list.
 *
 * @param animalList A list of animals.
 * @param currentAnimal The animal to be replaced.
 * @param newAnimal The animal to be used as replacement.
 * @return A new list with all occurrences of the current animal replaced with the new animal.
 */
fun replaceWithNone(animalList: List<String>, currentAnimal: String, newAnimal: String): List<String> {

    return animalList.map { if (it == currentAnimal) newAnimal else it }
}