/**
 * Given a name, age, and list of interests, return the name of the anthropologist if their age is greater than
 * or equal to 40 and the intersection of their interests and the given interests list is non-empty. Otherwise,
 * return an empty string.
 *
 * @param name The name of the anthropologist.
 * @param age The age of the anthropologist.
 * @param interests A list of interests of the anthropologist.
 * @return The name of the anthropologist if the conditions are met, an empty string otherwise.
 */
fun getAnthropologist(name: String, age: Int, interests: List<String>): String {

    // Check if age is greater than or equal to 40
    if (age >= 40) {
        // Perform intersection check to see if interests and given interests have non-empty intersection
        if (interests.any { it in interests }) {
            return name  // Return the name of the anthropologist
        }
    }
    return ""  // Return an empty string
}

// Exercise: Complete the code below to retrieve the name of the anthropologist if their age is greater than or equal
// to 40 and
/**
 * Given a name, age, and list of interests, return the name of the anthropologist if their age is greater than
 * or equal to 40 and the intersection of their interests and the given interests list is non-empty. Otherwise,
 * return an empty string.
 *
 * @param name The name of the anthropologist.
 * @param age The age of the anthropologist.
 * @param interests A list of interests of the anthropologist.
 * @return The name of the anthropologist if the conditions are met, an empty string otherwise.
 */
fun getAnthropologist(name: String, age: Int, interests: List<String>): String {
/**
 * Given a name, age, and list of interests, return the name of the anthropologist if their age is greater than
 * or equal to 40 and the intersection of their interests and the given interests list is non-empty. Otherwise,
 * return an empty string.
 *
 * @param name The name of the anthropologist.
 * @param age The age of the anthropologist.
 * @param interests A list of interests of the anthropologist.
 * @return The name of the anthropologist if the conditions are met, an empty string otherwise.
 */
fun getAnthropologist(name: String, age: Int, interests: List<String>): String {

    // Check if age is greater than or equal to 40
    if (age >= 40) {
        // Perform intersection check to see if interests and given interests have non-empty intersection
        if (interests.any { it in interests }) {
            return name  // Return the name of the anthropologist
        }
    }
    return ""  // Return an empty string
}

// Exercise: Complete the code below to retrieve the name of the anthropologist if their age is greater than or equal
// to 40 and