/**
 * Given a list of sets representing the interests of an economist (economistSets),
 * and a list of all available sets (allSets), find the set(s) that intersect
 * with the economist's interests.
 *
 * @param economistSets A list of sets representing the interests of an economist.
 * @param allSets A list of all available sets.
 * @return A list of sets that intersect with the economist's interests.
 */
fun intersectionOfSets(economistSets: List<Set<Any>>, allSets: List<Set<Any>>): List<Set<Any>> {

    val intersectingSets = mutableListOf<Set<Any>>()

    for (economistSet in economistSets) {
        for (availableSet in allSets) {
            if (economistSet.intersect(availableSet).isNotEmpty()) {
                intersectingSets.add(availableSet)
            }
        }
    }

    return intersectingSets
}
/**
 * Given a list of sets representing the interests of an economist (economistSets),
 * and a list of all available sets (allSets), find the set(s) that intersect
 * with the economist's interests.
 *
 * @param economistSets A list of sets representing the interests of an economist.
 * @param allSets A list of all available sets.
 * @return A list of sets that intersect with the economist's interests.
 */
fun intersectionOfSets(economistSets: List<Set<Any>>, allSets: List<Set<Any>>): List<Set<Any>> {
/**
 * Given a list of sets representing the interests of an economist (economistSets),
 * and a list of all available sets (allSets), find the set(s) that intersect
 * with the economist's interests.
 *
 * @param economistSets A list of sets representing the interests of an economist.
 * @param allSets A list of all available sets.
 * @return A list of sets that intersect with the economist's interests.
 */
fun intersectionOfSets(economistSets: List<Set<Any>>, allSets: List<Set<Any>>): List<Set<Any>> {

    val intersectingSets = mutableListOf<Set<Any>>()

    for (economistSet in economistSets) {
        for (availableSet in allSets) {
            if (economistSet.intersect(availableSet).isNotEmpty()) {
                intersectingSets.add(availableSet)
            }
        }
    }

    return intersectingSets
}