/**
 * This exercise requires the anthropologist to write a function that finds the intersection of
 * elements between a set and a list. The function should return a new list containing only the
 * elements that are common to both the set and the list.
 *
 * @param set1 A set of elements
 * @param list1 A list of elements
 * @return A list of elements that are common between set1 and list1
 */
fun intersectionOfSetsAndList(set1: Set<Any>, list1: List<Any>): List<Any> {

    // Convert the set to a list
    val setList = set1.toList()

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Any>()

    // Loop through each element in the set
    for (element in setList) {
        // Check if the element exists in the list
        if (element in list1) {
            // Append the common element to the list
            commonElements.add(element)
        }
    }

    // Return the list of common elements
    return commonElements
}
/**
 * This exercise requires the anthropologist to write a function that finds the intersection of
 * elements between a set and a list. The function should return a new list containing only the
 * elements that are common to both the set and the list.
 *
 * @param set1 A set of elements
 * @param list1 A list of elements
 * @return A list of elements that are common between set1 and list1
 */
fun intersectionOfSetsAndList(set1: Set<Any>, list1: List<Any>): List<Any> {
/**
 * This exercise requires the anthropologist to write a function that finds the intersection of
 * elements between a set and a list. The function should return a new list containing only the
 * elements that are common to both the set and the list.
 *
 * @param set1 A set of elements
 * @param list1 A list of elements
 * @return A list of elements that are common between set1 and list1
 */
fun intersectionOfSetsAndList(set1: Set<Any>, list1: List<Any>): List<Any> {

    // Convert the set to a list
    val setList = set1.toList()

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Any>()

    // Loop through each element in the set
    for (element in setList) {
        // Check if the element exists in the list
        if (element in list1) {
            // Append the common element to the list
            commonElements.add(element)
        }
    }

    // Return the list of common elements
    return commonElements
}