/**
 * Given a dictionary and a list of nested lists, the function should return a list of keys that appear in all nested lists within the dictionary.
 *
 * @param dataDict a dictionary with string keys and lists as values
 * @param nestedLists a list of nested lists
 * @return a list of keys that appear in all nested lists within the dictionary
 */
fun findIntersectingKeys(dataDict: Map<String, List<Any>>, nestedLists: List<List<Any>>): List<String> {

    val intersectingKeys = mutableListOf<String>()

    // Loop through each key-value pair in the dictionary
    for ((key, value) in dataDict) {
        // Flag to check if key appears in all nested lists
        var allAppearances = true

        // Loop through each nested list
        for (nestedList in nestedLists) {
            // Check if key is present in the nested list
            if (key !in nestedList) {
                allAppearances = false
                break
            }
        }

        // If key appears in all nested lists, add it to intersectingKeys
        if (allAppearances) {
            intersectingKeys.add(key)
        }
    }

    return intersectingKeys
}
/**
 * Given a dictionary and a list of nested lists, the function should return a list of keys that appear in all nested lists within the dictionary.
 *
 * @param dataDict a dictionary with string keys and lists as values
 * @param nestedLists a list of nested lists
 * @return a list of keys that appear in all nested lists within the dictionary
 */
fun findIntersectingKeys(dataDict: Map<String, List<Any>>, nestedLists: List<List<Any>>): List<String> {
/**
 * Given a dictionary and a list of nested lists, the function should return a list of keys that appear in all nested lists within the dictionary.
 *
 * @param dataDict a dictionary with string keys and lists as values
 * @param nestedLists a list of nested lists
 * @return a list of keys that appear in all nested lists within the dictionary
 */
fun findIntersectingKeys(dataDict: Map<String, List<Any>>, nestedLists: List<List<Any>>): List<String> {

    val intersectingKeys = mutableListOf<String>()

    // Loop through each key-value pair in the dictionary
    for ((key, value) in dataDict) {
        // Flag to check if key appears in all nested lists
        var allAppearances = true

        // Loop through each nested list
        for (nestedList in nestedLists) {
            // Check if key is present in the nested list
            if (key !in nestedList) {
                allAppearances = false
                break
            }
        }

        // If key appears in all nested lists, add it to intersectingKeys
        if (allAppearances) {
            intersectingKeys.add(key)
        }
    }

    return intersectingKeys
}