/**
 * Exercise: Modifying dictionary items by manipulating strings using loops
 *
 * Given a dictionary with string values, modify each value by replacing all vowels with the letter 'x' using loops.
 * Return the modified dictionary.
 *
 * @param dictionary Dictionary with string values
 * @return Modified dictionary with string values
 *
 * Example:
 * Input:
 * dictionary = mapOf("key1" to "apple", "key2" to "banana", "key3" to "cherry")
 *
 * Output:
 * mapOf("key1" to "xxplxx", "key2" to "bxnxnx", "key3" to "chxrry")
 */
fun changeDictionaryStrings(dictionary: Map<String, String>): Map<String, String> {

    val vowels = listOf('a', 'e', 'i', 'o', 'u')
    val modifiedDict = dictionary.toMutableMap()

    for ((key, value) in modifiedDict) {
        var newString = ""
        for (char in value) {
            if (char.toLowerCase() in vowels) {
                newString += 'x'
            } else {
                newString += char
            }
        }
        modifiedDict[key] = newString
    }

    return modifiedDict
}
/**
 * Exercise: Modifying dictionary items by manipulating strings using loops
 *
 * Given a dictionary with string values, modify each value by replacing all vowels with the letter 'x' using loops.
 * Return the modified dictionary.
 *
 * @param dictionary Dictionary with string values
 * @return Modified dictionary with string values
 *
 * Example:
 * Input:
 * dictionary = mapOf("key1" to "apple", "key2" to "banana", "key3" to "cherry")
 *
 * Output:
 * mapOf("key1" to "xxplxx", "key2" to "bxnxnx", "key3" to "chxrry")
 */
fun changeDictionaryStrings(dictionary: Map<String, String>): Map<String, String> {
/**
 * Exercise: Modifying dictionary items by manipulating strings using loops
 *
 * Given a dictionary with string values, modify each value by replacing all vowels with the letter 'x' using loops.
 * Return the modified dictionary.
 *
 * @param dictionary Dictionary with string values
 * @return Modified dictionary with string values
 *
 * Example:
 * Input:
 * dictionary = mapOf("key1" to "apple", "key2" to "banana", "key3" to "cherry")
 *
 * Output:
 * mapOf("key1" to "xxplxx", "key2" to "bxnxnx", "key3" to "chxrry")
 */
fun changeDictionaryStrings(dictionary: Map<String, String>): Map<String, String> {

    val vowels = listOf('a', 'e', 'i', 'o', 'u')
    val modifiedDict = dictionary.toMutableMap()

    for ((key, value) in modifiedDict) {
        var newString = ""
        for (char in value) {
            if (char.toLowerCase() in vowels) {
                newString += 'x'
            } else {
                newString += char
            }
        }
        modifiedDict[key] = newString
    }

    return modifiedDict
}