/**
 * Given a dictionary of veterinarian records and a patient's name, this function finds the treatment
 * history of the patient and returns it.
 *
 * @param vetRecords A dictionary representing the veterinarian's records, where the keys are patient names
 *                   and the values are pairs with the patient's species and treatment history.
 * @param patientName The name of the patient.
 * @return A list of treatment history for the patient.
 * @throws IllegalArgumentException If the patient name is not found in the records.
 */
fun findTreatment(vetRecords: Map<String, Pair<String, List<String>>>, patientName: String): List<String> {

    return vetRecords[patientName]?.second ?: throw IllegalArgumentException("Patient name not found in records.")
}

// Example usage

val vetRecords = mapOf(
    "Fluffy" to Pair("Cat", listOf("Vaccination", "Deworming")),
    "Max" to Pair("Dog", listOf("Vaccination", "Flea treatment", "Dental cleaning")),
    "Buddy" to Pair("Dog", listOf("Vaccination", "Flea treatment")),
    "Whiskers" to Pair("Cat", listOf("Vaccination", "Spaying"))
)

val patientName = "Max"
/**
 * Given a dictionary of veterinarian records and a patient's name, this function finds the treatment
 * history of the patient and returns it.
 *
 * @param vetRecords A dictionary representing the veterinarian's records, where the keys are patient names
 *                   and the values are pairs with the patient's species and treatment history.
 * @param patientName The name of the patient.
 * @return A list of treatment history for the patient.
 * @throws IllegalArgumentException If the patient name is not found in the records.
 */
fun findTreatment(vetRecords: Map<String, Pair<String, List<String>>>, patientName: String): List<String> {
/**
 * Given a dictionary of veterinarian records and a patient's name, this function finds the treatment
 * history of the patient and returns it.
 *
 * @param vetRecords A dictionary representing the veterinarian's records, where the keys are patient names
 *                   and the values are pairs with the patient's species and treatment history.
 * @param patientName The name of the patient.
 * @return A list of treatment history for the patient.
 * @throws IllegalArgumentException If the patient name is not found in the records.
 */
fun findTreatment(vetRecords: Map<String, Pair<String, List<String>>>, patientName: String): List<String> {

    return vetRecords[patientName]?.second ?: throw IllegalArgumentException("Patient name not found in records.")
}

// Example usage

val vetRecords = mapOf(
    "Fluffy" to Pair("Cat", listOf("Vaccination", "Deworming")),
    "Max" to Pair("Dog", listOf("Vaccination", "Flea treatment", "Dental cleaning")),
    "Buddy" to Pair("Dog", listOf("Vaccination", "Flea treatment")),
    "Whiskers" to Pair("Cat", listOf("Vaccination", "Spaying"))
)

val patientName = "Max"