/**
 * Exercise: Modify values in the dictionary using a while loop
 *
 * Modify the values in the given musicianDict by removing all spaces from the values.
 * Use a while loop to iterate through the dictionary values and replace the spaces.
 *
 * @param musicianDict A dictionary containing musician names as keys and their respective music genres as values.
 * @return The updated musicianDict with modified values.
 */
fun replaceValueInDict(musicianDict: MutableMap<String, String>): MutableMap<String, String> {

    // Iterate over the values in the dictionary
    for ((key, value) in musicianDict) {
        var updatedValue = value
        while (true) {
            if (' ' in updatedValue) {
                // Remove spaces from the value
                updatedValue = updatedValue.replace(" ", "")
            } else {
                break
            }
        }
        musicianDict[key] = updatedValue  // Update the dictionary with modified value
    }
    return musicianDict
}
/**
 * Exercise: Modify values in the dictionary using a while loop
 *
 * Modify the values in the given musicianDict by removing all spaces from the values.
 * Use a while loop to iterate through the dictionary values and replace the spaces.
 *
 * @param musicianDict A dictionary containing musician names as keys and their respective music genres as values.
 * @return The updated musicianDict with modified values.
 */
fun replaceValueInDict(musicianDict: MutableMap<String, String>): MutableMap<String, String> {
/**
 * Exercise: Modify values in the dictionary using a while loop
 *
 * Modify the values in the given musicianDict by removing all spaces from the values.
 * Use a while loop to iterate through the dictionary values and replace the spaces.
 *
 * @param musicianDict A dictionary containing musician names as keys and their respective music genres as values.
 * @return The updated musicianDict with modified values.
 */
fun replaceValueInDict(musicianDict: MutableMap<String, String>): MutableMap<String, String> {

    // Iterate over the values in the dictionary
    for ((key, value) in musicianDict) {
        var updatedValue = value
        while (true) {
            if (' ' in updatedValue) {
                // Remove spaces from the value
                updatedValue = updatedValue.replace(" ", "")
            } else {
                break
            }
        }
        musicianDict[key] = updatedValue  // Update the dictionary with modified value
    }
    return musicianDict
}