/**
 * Given a list of dictionaries, this function finds the common keys present in all dictionaries.
 *
 * @param dictionaryList A list of dictionaries
 * @return A set containing the common keys
 *
 * Example:
 * val dictionaryList = listOf(mapOf("a" to 1, "b" to 2, "c" to 3), mapOf("b" to 4, "c" to 5, "d" to 6), mapOf("c" to 7, "d" to 8, "e" to 9))
 * val commonKeys = findCommonKeys(dictionaryList)
 * println(commonKeys)  // Output: [c]
 */
fun findCommonKeys(dictionaryList: List<Map<String, Int>>): Set<String> {

    var commonKeys = dictionaryList[0].keys.toSet()  // Start with the keys of the first dictionary
    for (dictionary in dictionaryList.drop(1)) {
        commonKeys = commonKeys.intersect(dictionary.keys)
    }
    return commonKeys
}
/**
 * Given a list of dictionaries, this function finds the common keys present in all dictionaries.
 *
 * @param dictionaryList A list of dictionaries
 * @return A set containing the common keys
 *
 * Example:
 * val dictionaryList = listOf(mapOf("a" to 1, "b" to 2, "c" to 3), mapOf("b" to 4, "c" to 5, "d" to 6), mapOf("c" to 7, "d" to 8, "e" to 9))
 * val commonKeys = findCommonKeys(dictionaryList)
 * println(commonKeys)  // Output: [c]
 */
fun findCommonKeys(dictionaryList: List<Map<String, Int>>): Set<String> {
/**
 * Given a list of dictionaries, this function finds the common keys present in all dictionaries.
 *
 * @param dictionaryList A list of dictionaries
 * @return A set containing the common keys
 *
 * Example:
 * val dictionaryList = listOf(mapOf("a" to 1, "b" to 2, "c" to 3), mapOf("b" to 4, "c" to 5, "d" to 6), mapOf("c" to 7, "d" to 8, "e" to 9))
 * val commonKeys = findCommonKeys(dictionaryList)
 * println(commonKeys)  // Output: [c]
 */
fun findCommonKeys(dictionaryList: List<Map<String, Int>>): Set<String> {

    var commonKeys = dictionaryList[0].keys.toSet()  // Start with the keys of the first dictionary
    for (dictionary in dictionaryList.drop(1)) {
        commonKeys = commonKeys.intersect(dictionary.keys)
    }
    return commonKeys
}