/**
 * Given a list of pets, replace all occurrences of the oldPet with the newPet in the list and return the modified list.
 *
 * @param pets A list of pets
 * @param oldPet The pet to be replaced
 * @param newPet The pet to replace the oldPet with
 * @return The modified list of pets with replacements made
 */
fun replacePet(pets: List<String>, oldPet: String, newPet: String): List<String> {

    return pets.map { if (it == oldPet) newPet else it }
}
/**
 * Given a list of pets, replace all occurrences of the oldPet with the newPet in the list and return the modified list.
 *
 * @param pets A list of pets
 * @param oldPet The pet to be replaced
 * @param newPet The pet to replace the oldPet with
 * @return The modified list of pets with replacements made
 */
fun replacePet(pets: List<String>, oldPet: String, newPet: String): List<String> {
/**
 * Given a list of pets, replace all occurrences of the oldPet with the newPet in the list and return the modified list.
 *
 * @param pets A list of pets
 * @param oldPet The pet to be replaced
 * @param newPet The pet to replace the oldPet with
 * @return The modified list of pets with replacements made
 */
fun replacePet(pets: List<String>, oldPet: String, newPet: String): List<String> {

    return pets.map { if (it == oldPet) newPet else it }
}