/**
 * Given two sets of nested lists, find the common elements in both sets.
 *
 * @param set1 A set containing nested lists.
 * @param set2 Another set containing nested lists.
 * @return A list containing the common elements found in both sets.
 */
fun findCommonElements(set1: List<List<Any>>, set2: List<List<Any>>): List<Any> {

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

    // Iterate over each element in set1
    for (subList in set1) {
        for (nestedElement in subList) {
            // Check if the nested element exists in set2
            if (set2.any { sublist -> nestedElement in sublist }) {
                // Append the common element to the list
                commonElements.add(nestedElement)
            }
        }
    }

    return commonElements
}
/**
 * Given two sets of nested lists, find the common elements in both sets.
 *
 * @param set1 A set containing nested lists.
 * @param set2 Another set containing nested lists.
 * @return A list containing the common elements found in both sets.
 */
fun findCommonElements(set1: List<List<Any>>, set2: List<List<Any>>): List<Any> {
/**
 * Given two sets of nested lists, find the common elements in both sets.
 *
 * @param set1 A set containing nested lists.
 * @param set2 Another set containing nested lists.
 * @return A list containing the common elements found in both sets.
 */
fun findCommonElements(set1: List<List<Any>>, set2: List<List<Any>>): List<Any> {

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

    // Iterate over each element in set1
    for (subList in set1) {
        for (nestedElement in subList) {
            // Check if the nested element exists in set2
            if (set2.any { sublist -> nestedElement in sublist }) {
                // Append the common element to the list
                commonElements.add(nestedElement)
            }
        }
    }

    return commonElements
}