/**
 * Given two dictionaries representing electrical appliances and tools,
 * this function finds the common elements (keys) present in both dictionaries.
 *
 * @param electricalAppliances A dictionary representing electrical appliances.
 * @param electricalTools A dictionary representing electrical tools.
 * @return A list of common keys present in both dictionaries.
 *
 * Example:
 * val electricalAppliances = mapOf(
 *     "refrigerator" to 500,
 *     "washing_machine" to 800,
 *     "dishwasher" to 600,
 *     "microwave" to 400
 * )
 * val electricalTools = mapOf(
 *     "microwave" to 800,
 *     "drill" to 1200,
 *     "hammer" to 500,
 *     "multimeter" to 1500
 * )
 * findCommonElements(electricalAppliances, electricalTools) // Output: ["microwave"]
 */
fun findCommonElements(electricalAppliances: Map<String, Int>, electricalTools: Map<String, Int>): List<String> {

    val commonElements = mutableListOf<String>()

    for (appliance in electricalAppliances.keys) {
        if (appliance in electricalTools.keys) {
            commonElements.add(appliance)
        }
    }

    return commonElements
}
/**
 * Given two dictionaries representing electrical appliances and tools,
 * this function finds the common elements (keys) present in both dictionaries.
 *
 * @param electricalAppliances A dictionary representing electrical appliances.
 * @param electricalTools A dictionary representing electrical tools.
 * @return A list of common keys present in both dictionaries.
 *
 * Example:
 * val electricalAppliances = mapOf(
 *     "refrigerator" to 500,
 *     "washing_machine" to 800,
 *     "dishwasher" to 600,
 *     "microwave" to 400
 * )
 * val electricalTools = mapOf(
 *     "microwave" to 800,
 *     "drill" to 1200,
 *     "hammer" to 500,
 *     "multimeter" to 1500
 * )
 * findCommonElements(electricalAppliances, electricalTools) // Output: ["microwave"]
 */
fun findCommonElements(electricalAppliances: Map<String, Int>, electricalTools: Map<String, Int>): List<String> {
/**
 * Given two dictionaries representing electrical appliances and tools,
 * this function finds the common elements (keys) present in both dictionaries.
 *
 * @param electricalAppliances A dictionary representing electrical appliances.
 * @param electricalTools A dictionary representing electrical tools.
 * @return A list of common keys present in both dictionaries.
 *
 * Example:
 * val electricalAppliances = mapOf(
 *     "refrigerator" to 500,
 *     "washing_machine" to 800,
 *     "dishwasher" to 600,
 *     "microwave" to 400
 * )
 * val electricalTools = mapOf(
 *     "microwave" to 800,
 *     "drill" to 1200,
 *     "hammer" to 500,
 *     "multimeter" to 1500
 * )
 * findCommonElements(electricalAppliances, electricalTools) // Output: ["microwave"]
 */
fun findCommonElements(electricalAppliances: Map<String, Int>, electricalTools: Map<String, Int>): List<String> {

    val commonElements = mutableListOf<String>()

    for (appliance in electricalAppliances.keys) {
        if (appliance in electricalTools.keys) {
            commonElements.add(appliance)
        }
    }

    return commonElements
}