/**
 * This function takes a mutable map 'd', a string 'key', and an integer 'value' as inputs.
 * It modifies the value corresponding to the given key in the map by incrementing it with the given value.
 * If the key is not present in the map, it adds the key-value pair to the map.
 * Returns the modified or updated map.
 */
fun modifyDictionary(d: MutableMap<String, Int>, key: String, value: Int): MutableMap<String, Int> {

    if (key.isNotEmpty() && value is Int) {
        // Check if the key exists in the map
        if (d.containsKey(key)) {
            // Increment the value associated with the key
            d[key] = d.getValue(key) + value
        } else {
            // Add a new key-value pair to the map
            d[key] = value
        }
    }
    return d
}
/**
 * This function takes a mutable map 'd', a string 'key', and an integer 'value' as inputs.
 * It modifies the value corresponding to the given key in the map by incrementing it with the given value.
 * If the key is not present in the map, it adds the key-value pair to the map.
 * Returns the modified or updated map.
 */
fun modifyDictionary(d: MutableMap<String, Int>, key: String, value: Int): MutableMap<String, Int> {
/**
 * This function takes a mutable map 'd', a string 'key', and an integer 'value' as inputs.
 * It modifies the value corresponding to the given key in the map by incrementing it with the given value.
 * If the key is not present in the map, it adds the key-value pair to the map.
 * Returns the modified or updated map.
 */
fun modifyDictionary(d: MutableMap<String, Int>, key: String, value: Int): MutableMap<String, Int> {

    if (key.isNotEmpty() && value is Int) {
        // Check if the key exists in the map
        if (d.containsKey(key)) {
            // Increment the value associated with the key
            d[key] = d.getValue(key) + value
        } else {
            // Add a new key-value pair to the map
            d[key] = value
        }
    }
    return d
}