/**
 * This function finds the common letters between all words in a given dictionary.
 *
 * @param wordsDict A dictionary with words as keys and their meanings as values.
 * @return A set of common letters found in all words.
 */
fun findCommonLetters(wordsDict: Map<String, String>): Set<Char> {

    val commonLetters = mutableSetOf<Char>()  // Initialize an empty set to store common letters

    // Loop through each character in the first word
    for (char in wordsDict.values.first()) {
        var isCommon = true  // Flag to check if the current character is common in all words

        // Loop through each word in the dictionary besides the first one
        for (word in wordsDict.values.drop(1)) {
            if (char !in word) {
                isCommon = false  // If the character is not present in any of the other words, set flag to False
                break
            }
        }

        if (isCommon) {
            commonLetters.add(char)  // Add the character to the set of common letters
        }
    }

    return commonLetters
}
/**
 * This function finds the common letters between all words in a given dictionary.
 *
 * @param wordsDict A dictionary with words as keys and their meanings as values.
 * @return A set of common letters found in all words.
 */
fun findCommonLetters(wordsDict: Map<String, String>): Set<Char> {
/**
 * This function finds the common letters between all words in a given dictionary.
 *
 * @param wordsDict A dictionary with words as keys and their meanings as values.
 * @return A set of common letters found in all words.
 */
fun findCommonLetters(wordsDict: Map<String, String>): Set<Char> {

    val commonLetters = mutableSetOf<Char>()  // Initialize an empty set to store common letters

    // Loop through each character in the first word
    for (char in wordsDict.values.first()) {
        var isCommon = true  // Flag to check if the current character is common in all words

        // Loop through each word in the dictionary besides the first one
        for (word in wordsDict.values.drop(1)) {
            if (char !in word) {
                isCommon = false  // If the character is not present in any of the other words, set flag to False
                break
            }
        }

        if (isCommon) {
            commonLetters.add(char)  // Add the character to the set of common letters
        }
    }

    return commonLetters
}