/**
 * Given two dictionaries, find and return a list of common keys present in both dictionaries.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list containing common keys present in both dictionaries.
 *
 * Examples:
 * '``
 * val dict1 = mapOf("a" to 1, "b" to 2, "c" to 3)
 * val dict2 = mapOf("b" to 4, "c" to 5, "d" to 6)
 * findCommonKeys(dict1, dict2) // Output: ['b', 'c']
 *
 * val dict3 = mapOf("x" to 1, "y" to 2, "z" to 3, "w" to 4)
 * val dict4 = mapOf("y" to 5, "z" to 6, "v" to 7, "w" to 8)
 * findCommonKeys(dict3, dict4) // Output: ['y', 'z', 'w']
 * '``
 */
fun findCommonKeys(dict1: Map<String, Int>, dict2: Map<String, Int>): List<String> {

    val commonKeys = mutableListOf<String>()
    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 present in both dictionaries.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list containing common keys present in both dictionaries.
 *
 * Examples:
 * '``
 * val dict1 = mapOf("a" to 1, "b" to 2, "c" to 3)
 * val dict2 = mapOf("b" to 4, "c" to 5, "d" to 6)
 * findCommonKeys(dict1, dict2) // Output: ['b', 'c']
 *
 * val dict3 = mapOf("x" to 1, "y" to 2, "z" to 3, "w" to 4)
 * val dict4 = mapOf("y" to 5, "z" to 6, "v" to 7, "w" to 8)
 * findCommonKeys(dict3, dict4) // Output: ['y', 'z', 'w']
 * '``
 */
fun findCommonKeys(dict1: Map<String, Int>, dict2: Map<String, Int>): List<String> {
/**
 * Given two dictionaries, find and return a list of common keys present in both dictionaries.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list containing common keys present in both dictionaries.
 *
 * Examples:
 * '``
 * val dict1 = mapOf("a" to 1, "b" to 2, "c" to 3)
 * val dict2 = mapOf("b" to 4, "c" to 5, "d" to 6)
 * findCommonKeys(dict1, dict2) // Output: ['b', 'c']
 *
 * val dict3 = mapOf("x" to 1, "y" to 2, "z" to 3, "w" to 4)
 * val dict4 = mapOf("y" to 5, "z" to 6, "v" to 7, "w" to 8)
 * findCommonKeys(dict3, dict4) // Output: ['y', 'z', 'w']
 * '``
 */
fun findCommonKeys(dict1: Map<String, Int>, dict2: Map<String, Int>): List<String> {

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