/**
 * Given the name of a physician and a list of specialties, this function returns the common specialties
 * of the physician from the provided list.
 *
 * @param physician The name of the physician.
 * @param specialties A list of specialties to check for intersection.
 * @return A list of common specialties of the physician from the provided list.
 */
fun getPhysicianSpecializations(physician: String, specialties: List<String>): List<String> {

    val physicianSpecialties = listOf("Cardiology", "Dermatology", "Endocrinology", "Gastroenterology", "Hematology",
        "Internal Medicine", "Neurology", "Oncology", "Pediatrics", "Radiology")

    // Check for intersection using the union operator (|)
    val commonSpecialties = (specialties.toSet() union physicianSpecialties.toSet()).toList()

    return commonSpecialties
}
/**
 * Given the name of a physician and a list of specialties, this function returns the common specialties
 * of the physician from the provided list.
 *
 * @param physician The name of the physician.
 * @param specialties A list of specialties to check for intersection.
 * @return A list of common specialties of the physician from the provided list.
 */
fun getPhysicianSpecializations(physician: String, specialties: List<String>): List<String> {
/**
 * Given the name of a physician and a list of specialties, this function returns the common specialties
 * of the physician from the provided list.
 *
 * @param physician The name of the physician.
 * @param specialties A list of specialties to check for intersection.
 * @return A list of common specialties of the physician from the provided list.
 */
fun getPhysicianSpecializations(physician: String, specialties: List<String>): List<String> {

    val physicianSpecialties = listOf("Cardiology", "Dermatology", "Endocrinology", "Gastroenterology", "Hematology",
        "Internal Medicine", "Neurology", "Oncology", "Pediatrics", "Radiology")

    // Check for intersection using the union operator (|)
    val commonSpecialties = (specialties.toSet() union physicianSpecialties.toSet()).toList()

    return commonSpecialties
}