/**
 * This exercise tests your ability to modify elements of a list. Given a list of animals in a veterinarian's office,
 * you need to add a new animal to the list only if the animal does not already exist in the list.
 *
 * @param vetList A list of animal names currently present at the veterinarian's office.
 * @param animalName The name of the new animal to be added.
 * @return The updated list of animal names after attempting to add the new animal.
 */
fun addUniqueAnimal(vetList: MutableList<String>, animalName: String): List<String> {

    // Check if the new animal already exists in the vetList
    if (animalName in vetList) {
        return vetList  // Return the unchanged list if the animal already exists
    }

    // Add the new animal to the vetList
    vetList.add(animalName)
    return vetList
}
/**
 * This exercise tests your ability to modify elements of a list. Given a list of animals in a veterinarian's office,
 * you need to add a new animal to the list only if the animal does not already exist in the list.
 *
 * @param vetList A list of animal names currently present at the veterinarian's office.
 * @param animalName The name of the new animal to be added.
 * @return The updated list of animal names after attempting to add the new animal.
 */
fun addUniqueAnimal(vetList: MutableList<String>, animalName: String): List<String> {
/**
 * This exercise tests your ability to modify elements of a list. Given a list of animals in a veterinarian's office,
 * you need to add a new animal to the list only if the animal does not already exist in the list.
 *
 * @param vetList A list of animal names currently present at the veterinarian's office.
 * @param animalName The name of the new animal to be added.
 * @return The updated list of animal names after attempting to add the new animal.
 */
fun addUniqueAnimal(vetList: MutableList<String>, animalName: String): List<String> {

    // Check if the new animal already exists in the vetList
    if (animalName in vetList) {
        return vetList  // Return the unchanged list if the animal already exists
    }

    // Add the new animal to the vetList
    vetList.add(animalName)
    return vetList
}