/**
 * This function finds a lawyer based on the given conditions:
 * 1. The lawyer's name and specialty should be provided as arguments.
 * 2. The lawyer must be at least 30 years old and have at least 10 years of experience.
 * 3. The lawyer must specialize in either criminal law or corporate law.
 *
 * @param name The name of the lawyer.
 * @param age The age of the lawyer.
 * @param yearsOfExperience The years of experience of the lawyer.
 * @param specialty The specialty of the lawyer.
 * @return The message indicating whether the lawyer satisfies the conditions or not.
 */
fun findLawyer(name: String, age: Int, yearsOfExperience: Int, specialty: String): String {

    return when {
        age >= 30 && yearsOfExperience >= 10 -> {
            if (specialty == "criminal law" || specialty == "corporate law") {
                "$name is a qualified lawyer."
            } else {
                "$name does not specialize in the required law field."
            }
        }
        else -> "$name does not meet the required experience and age criteria."
    }
}
/**
 * This function finds a lawyer based on the given conditions:
 * 1. The lawyer's name and specialty should be provided as arguments.
 * 2. The lawyer must be at least 30 years old and have at least 10 years of experience.
 * 3. The lawyer must specialize in either criminal law or corporate law.
 *
 * @param name The name of the lawyer.
 * @param age The age of the lawyer.
 * @param yearsOfExperience The years of experience of the lawyer.
 * @param specialty The specialty of the lawyer.
 * @return The message indicating whether the lawyer satisfies the conditions or not.
 */
fun findLawyer(name: String, age: Int, yearsOfExperience: Int, specialty: String): String {
/**
 * This function finds a lawyer based on the given conditions:
 * 1. The lawyer's name and specialty should be provided as arguments.
 * 2. The lawyer must be at least 30 years old and have at least 10 years of experience.
 * 3. The lawyer must specialize in either criminal law or corporate law.
 *
 * @param name The name of the lawyer.
 * @param age The age of the lawyer.
 * @param yearsOfExperience The years of experience of the lawyer.
 * @param specialty The specialty of the lawyer.
 * @return The message indicating whether the lawyer satisfies the conditions or not.
 */
fun findLawyer(name: String, age: Int, yearsOfExperience: Int, specialty: String): String {

    return when {
        age >= 30 && yearsOfExperience >= 10 -> {
            if (specialty == "criminal law" || specialty == "corporate law") {
                "$name is a qualified lawyer."
            } else {
                "$name does not specialize in the required law field."
            }
        }
        else -> "$name does not meet the required experience and age criteria."
    }
}