/**
 * Imagine you are a veterinarian and you need to search for the pet name and its owner in a string.
 * Your task is to create a function that takes a string containing pet names and their owners,
 * and a pet name as input. The function should return a pair with the pet name and its owner if found, and
 * "Pet not found!" if the pet name is not in the string.
 *
 * Example:
 * veterinarianSearch("Luna-Ana,Tiger-Sam,Max-John", "Tiger") -> Pair("Tiger", "Sam")
 * veterinarianSearch("Luna-Ana,Tiger-Sam,Max-John", "Charlie") -> "Pet not found!"
 */
fun veterinarianSearch(vetString: String, pet: String): Any {

    val vetDictionary = mutableMapOf<String, String>()

    // Creating dictionary of pet names and their owners
    for (pair in vetString.split(",")) {
        val (petName, ownerName) = pair.split("-")
        vetDictionary[petName] = ownerName
    }

    // Searching for the pet name in the dictionary
    return if (pet in vetDictionary) {
        Pair(pet, vetDictionary[pet])
    } else {
        "Pet not found!"
    }
}
/**
 * Imagine you are a veterinarian and you need to search for the pet name and its owner in a string.
 * Your task is to create a function that takes a string containing pet names and their owners,
 * and a pet name as input. The function should return a pair with the pet name and its owner if found, and
 * "Pet not found!" if the pet name is not in the string.
 *
 * Example:
 * veterinarianSearch("Luna-Ana,Tiger-Sam,Max-John", "Tiger") -> Pair("Tiger", "Sam")
 * veterinarianSearch("Luna-Ana,Tiger-Sam,Max-John", "Charlie") -> "Pet not found!"
 */
fun veterinarianSearch(vetString: String, pet: String): Any {
/**
 * Imagine you are a veterinarian and you need to search for the pet name and its owner in a string.
 * Your task is to create a function that takes a string containing pet names and their owners,
 * and a pet name as input. The function should return a pair with the pet name and its owner if found, and
 * "Pet not found!" if the pet name is not in the string.
 *
 * Example:
 * veterinarianSearch("Luna-Ana,Tiger-Sam,Max-John", "Tiger") -> Pair("Tiger", "Sam")
 * veterinarianSearch("Luna-Ana,Tiger-Sam,Max-John", "Charlie") -> "Pet not found!"
 */
fun veterinarianSearch(vetString: String, pet: String): Any {

    val vetDictionary = mutableMapOf<String, String>()

    // Creating dictionary of pet names and their owners
    for (pair in vetString.split(",")) {
        val (petName, ownerName) = pair.split("-")
        vetDictionary[petName] = ownerName
    }

    // Searching for the pet name in the dictionary
    return if (pet in vetDictionary) {
        Pair(pet, vetDictionary[pet])
    } else {
        "Pet not found!"
    }
}