/**
 * Given a dictionary, a key, and a value, this function updates the dictionary
 * by concatenating the value with the existing value associated with the key.
 * If the key does not exist, it adds the key-value pair to the dictionary.
 *
 * @param dictionary A dictionary to be updated.
 * @param key Key associated with the value.
 * @param value Value to be concatenated.
 * @return Updated dictionary.
 */
fun updateDictionaryWithConcatenation(dictionary: MutableMap<String, String>, key: String, value: String): MutableMap<String, String> {

    if (dictionary.containsKey(key) && dictionary[key] is String && value is String) {
        dictionary[key] = dictionary[key] + value
    } else {
        dictionary[key] = value
    }
    return dictionary
}
/**
 * Given a dictionary, a key, and a value, this function updates the dictionary
 * by concatenating the value with the existing value associated with the key.
 * If the key does not exist, it adds the key-value pair to the dictionary.
 *
 * @param dictionary A dictionary to be updated.
 * @param key Key associated with the value.
 * @param value Value to be concatenated.
 * @return Updated dictionary.
 */
fun updateDictionaryWithConcatenation(dictionary: MutableMap<String, String>, key: String, value: String): MutableMap<String, String> {
/**
 * Given a dictionary, a key, and a value, this function updates the dictionary
 * by concatenating the value with the existing value associated with the key.
 * If the key does not exist, it adds the key-value pair to the dictionary.
 *
 * @param dictionary A dictionary to be updated.
 * @param key Key associated with the value.
 * @param value Value to be concatenated.
 * @return Updated dictionary.
 */
fun updateDictionaryWithConcatenation(dictionary: MutableMap<String, String>, key: String, value: String): MutableMap<String, String> {

    if (dictionary.containsKey(key) && dictionary[key] is String && value is String) {
        dictionary[key] = dictionary[key] + value
    } else {
        dictionary[key] = value
    }
    return dictionary
}