/**
 * Given a dictionary 'items`, this function modifies the values of dictionary items that have a specified 'key`
 * by appending a 'suffix" to each value. It utilizes a while loop for iterating over the dictionary items.
 *
 * @param items The dictionary containing key-value pairs.
 * @param key The key to identify the dictionary items to be modified.
 * @param suffix The suffix to be appended to the values of dictionary items.
 * @return The modified dictionary with updated values.
 */
fun modifyDictWithWhileLoop(items: Map<String, String>, key: String, suffix: String): Map<String, String> {

    val modifiedDict = items.toMutableMap()
    val keysToModify = modifiedDict.keys.filter { it.contains(key) }
    var i = 0

    while (i < keysToModify.size) {
        val currentKey = keysToModify[i]
        modifiedDict[currentKey] = modifiedDict[currentKey] + suffix
        i++
    }

    return modifiedDict
}
/**
 * Given a dictionary 'items`, this function modifies the values of dictionary items that have a specified 'key`
 * by appending a 'suffix" to each value. It utilizes a while loop for iterating over the dictionary items.
 *
 * @param items The dictionary containing key-value pairs.
 * @param key The key to identify the dictionary items to be modified.
 * @param suffix The suffix to be appended to the values of dictionary items.
 * @return The modified dictionary with updated values.
 */
fun modifyDictWithWhileLoop(items: Map<String, String>, key: String, suffix: String): Map<String, String> {
/**
 * Given a dictionary 'items`, this function modifies the values of dictionary items that have a specified 'key`
 * by appending a 'suffix" to each value. It utilizes a while loop for iterating over the dictionary items.
 *
 * @param items The dictionary containing key-value pairs.
 * @param key The key to identify the dictionary items to be modified.
 * @param suffix The suffix to be appended to the values of dictionary items.
 * @return The modified dictionary with updated values.
 */
fun modifyDictWithWhileLoop(items: Map<String, String>, key: String, suffix: String): Map<String, String> {

    val modifiedDict = items.toMutableMap()
    val keysToModify = modifiedDict.keys.filter { it.contains(key) }
    var i = 0

    while (i < keysToModify.size) {
        val currentKey = keysToModify[i]
        modifiedDict[currentKey] = modifiedDict[currentKey] + suffix
        i++
    }

    return modifiedDict
}