/**
 * In this exercise, you need to write a function that takes two dictionaries as input and returns a list of common keys that are present in both dictionaries.
 *
 * Your task is to complete the function 'combineLists' that accepts two dictionaries 'dict1' and 'dict2' as arguments. The function should find the common keys that exist in both dictionaries and return them as a list.
 *
 * Example:
 * dict1 = mapOf("chair" to "blue", "table" to "brown", "lamp" to "white")
 * dict2 = mapOf("sofa" to "red", "table" to "black", "lamp" to "white")
 * combineLists(dict1, dict2) -> ['table', 'lamp']
 */
fun combineLists(dict1: Map<String, String>, dict2: Map<String, String>): List<String> {

    // Extracting the keys from both dictionaries
    val keys1 = dict1.keys.toList()
    val keys2 = dict2.keys.toList()

    // Finding the common keys
    val commonKeys = keys1.filter { it in keys2 }

    return commonKeys
}
/**
 * In this exercise, you need to write a function that takes two dictionaries as input and returns a list of common keys that are present in both dictionaries.
 *
 * Your task is to complete the function 'combineLists' that accepts two dictionaries 'dict1' and 'dict2' as arguments. The function should find the common keys that exist in both dictionaries and return them as a list.
 *
 * Example:
 * dict1 = mapOf("chair" to "blue", "table" to "brown", "lamp" to "white")
 * dict2 = mapOf("sofa" to "red", "table" to "black", "lamp" to "white")
 * combineLists(dict1, dict2) -> ['table', 'lamp']
 */
fun combineLists(dict1: Map<String, String>, dict2: Map<String, String>): List<String> {
/**
 * In this exercise, you need to write a function that takes two dictionaries as input and returns a list of common keys that are present in both dictionaries.
 *
 * Your task is to complete the function 'combineLists' that accepts two dictionaries 'dict1' and 'dict2' as arguments. The function should find the common keys that exist in both dictionaries and return them as a list.
 *
 * Example:
 * dict1 = mapOf("chair" to "blue", "table" to "brown", "lamp" to "white")
 * dict2 = mapOf("sofa" to "red", "table" to "black", "lamp" to "white")
 * combineLists(dict1, dict2) -> ['table', 'lamp']
 */
fun combineLists(dict1: Map<String, String>, dict2: Map<String, String>): List<String> {

    // Extracting the keys from both dictionaries
    val keys1 = dict1.keys.toList()
    val keys2 = dict2.keys.toList()

    // Finding the common keys
    val commonKeys = keys1.filter { it in keys2 }

    return commonKeys
}