/**
 * Given two dictionaries, find and return a list of common keys between them.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list of common keys present in both dictionaries.
 * @throws IllegalArgumentException If either dict1 or dict2 is not a dictionary.
 */
fun getCommonKeys(dict1: Map<Any, Any>, dict2: Map<Any, Any>): List<Any> {

    if (dict1 !is Map<*, *> || dict2 !is Map<*, *>) {
        throw IllegalArgumentException("Both arguments must be dictionaries.")
    }

    val commonKeys = mutableListOf<Any>()
    for (key in dict1.keys) {
        if (dict2.containsKey(key)) {
            commonKeys.add(key)
        }
    }

    return commonKeys
}
/**
 * Given two dictionaries, find and return a list of common keys between them.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list of common keys present in both dictionaries.
 * @throws IllegalArgumentException If either dict1 or dict2 is not a dictionary.
 */
fun getCommonKeys(dict1: Map<Any, Any>, dict2: Map<Any, Any>): List<Any> {
/**
 * Given two dictionaries, find and return a list of common keys between them.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list of common keys present in both dictionaries.
 * @throws IllegalArgumentException If either dict1 or dict2 is not a dictionary.
 */
fun getCommonKeys(dict1: Map<Any, Any>, dict2: Map<Any, Any>): List<Any> {

    if (dict1 !is Map<*, *> || dict2 !is Map<*, *>) {
        throw IllegalArgumentException("Both arguments must be dictionaries.")
    }

    val commonKeys = mutableListOf<Any>()
    for (key in dict1.keys) {
        if (dict2.containsKey(key)) {
            commonKeys.add(key)
        }
    }

    return commonKeys
}