/**
 * You are an archaeologist who has discovered two ancient dictionaries.
 * Your task is to find the uncommon words present in both dictionaries.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list of uncommon words present in both dictionaries.
 *
 * Example:
 * val dict1 = mapOf("apple" to 2, "banana" to 3, "cherry" to 4)
 * val dict2 = mapOf("banana" to 2, "date" to 3, "elderberry" to 4)
 * findUncommonWord(dict1, dict2) // Output: ["apple", "cherry", "date", "elderberry"]
 */
fun findUncommonWord(dict1: Map<String, Int>, dict2: Map<String, Int>): List<String> {

    val uncommonWords = mutableListOf<String>()

    // Find uncommon words in dict1 not in dict2
    for (word in dict1.keys) {
        if (word !in dict2) {
            uncommonWords.add(word)
        }
    }

    // Find uncommon words in dict2 not in dict1
    for (word in dict2.keys) {
        if (word !in dict1 && word !in uncommonWords) {
            uncommonWords.add(word)
        }
    }

    return uncommonWords
}
/**
 * You are an archaeologist who has discovered two ancient dictionaries.
 * Your task is to find the uncommon words present in both dictionaries.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list of uncommon words present in both dictionaries.
 *
 * Example:
 * val dict1 = mapOf("apple" to 2, "banana" to 3, "cherry" to 4)
 * val dict2 = mapOf("banana" to 2, "date" to 3, "elderberry" to 4)
 * findUncommonWord(dict1, dict2) // Output: ["apple", "cherry", "date", "elderberry"]
 */
fun findUncommonWord(dict1: Map<String, Int>, dict2: Map<String, Int>): List<String> {
/**
 * You are an archaeologist who has discovered two ancient dictionaries.
 * Your task is to find the uncommon words present in both dictionaries.
 *
 * @param dict1 The first dictionary.
 * @param dict2 The second dictionary.
 * @return A list of uncommon words present in both dictionaries.
 *
 * Example:
 * val dict1 = mapOf("apple" to 2, "banana" to 3, "cherry" to 4)
 * val dict2 = mapOf("banana" to 2, "date" to 3, "elderberry" to 4)
 * findUncommonWord(dict1, dict2) // Output: ["apple", "cherry", "date", "elderberry"]
 */
fun findUncommonWord(dict1: Map<String, Int>, dict2: Map<String, Int>): List<String> {

    val uncommonWords = mutableListOf<String>()

    // Find uncommon words in dict1 not in dict2
    for (word in dict1.keys) {
        if (word !in dict2) {
            uncommonWords.add(word)
        }
    }

    // Find uncommon words in dict2 not in dict1
    for (word in dict2.keys) {
        if (word !in dict1 && word !in uncommonWords) {
            uncommonWords.add(word)
        }
    }

    return uncommonWords
}