/**
 * In this exercise, you are given a physician's details as a list and need to change their primary specialty.
 * The physician list contains the following information:
 * - First name (string)
 * - Last name (string)
 * - Age (integer)
 * - Primary Specialty (string)
 * - Years of Experience (integer)
 *
 * Your task is to write a function that takes the physician list and a new specialty as input and returns a new list
 * with the updated primary specialty for the physician.
 *
 * Example:
 *
 * Input:
 * Physician list: ["Dr. John", "Smith", 35, "Pediatrics", 10]
 * New specialty: "Cardiology"
 *
 * Output:
 * ["Dr. John", "Smith", 35, "Cardiology", 10]
 */
fun changePrimarySpecialty(physician: List<Any>, newSpecialty: String): List<Any> {

    // Extracting the individual elements from the physician list
    val (firstName, lastName, age, primarySpecialty, yearsOfExperience) = physician

    // Creating a new list with the updated primary specialty
    return listOf(firstName, lastName, age, newSpecialty, yearsOfExperience)
}
/**
 * In this exercise, you are given a physician's details as a list and need to change their primary specialty.
 * The physician list contains the following information:
 * - First name (string)
 * - Last name (string)
 * - Age (integer)
 * - Primary Specialty (string)
 * - Years of Experience (integer)
 *
 * Your task is to write a function that takes the physician list and a new specialty as input and returns a new list
 * with the updated primary specialty for the physician.
 *
 * Example:
 *
 * Input:
 * Physician list: ["Dr. John", "Smith", 35, "Pediatrics", 10]
 * New specialty: "Cardiology"
 *
 * Output:
 * ["Dr. John", "Smith", 35, "Cardiology", 10]
 */
fun changePrimarySpecialty(physician: List<Any>, newSpecialty: String): List<Any> {
/**
 * In this exercise, you are given a physician's details as a list and need to change their primary specialty.
 * The physician list contains the following information:
 * - First name (string)
 * - Last name (string)
 * - Age (integer)
 * - Primary Specialty (string)
 * - Years of Experience (integer)
 *
 * Your task is to write a function that takes the physician list and a new specialty as input and returns a new list
 * with the updated primary specialty for the physician.
 *
 * Example:
 *
 * Input:
 * Physician list: ["Dr. John", "Smith", 35, "Pediatrics", 10]
 * New specialty: "Cardiology"
 *
 * Output:
 * ["Dr. John", "Smith", 35, "Cardiology", 10]
 */
fun changePrimarySpecialty(physician: List<Any>, newSpecialty: String): List<Any> {

    // Extracting the individual elements from the physician list
    val (firstName, lastName, age, primarySpecialty, yearsOfExperience) = physician

    // Creating a new list with the updated primary specialty
    return listOf(firstName, lastName, age, newSpecialty, yearsOfExperience)
}