/**
 * This function takes a dictionary and updates it by subtracting the value from the existing value associated with the key, if the key exists in the dictionary.
 * If the key does not exist in the dictionary, it adds the key-value pair to the dictionary with the value as -value.
 *
 * @param dictionary The dictionary to be updated.
 * @param key The key to be used for updating the dictionary.
 * @param value The value to be subtracted from the existing value associated with the key.
 * @return The updated dictionary.
 */
fun updateDictionary(dictionary: MutableMap<Any, Int>, key: Any, value: Int): MutableMap<Any, Int> {

    if (key in dictionary) {
        dictionary[key] = dictionary[key]!! - value
    } else {
        dictionary[key] = -value
    }
    return dictionary
}
/**
 * This function takes a dictionary and updates it by subtracting the value from the existing value associated with the key, if the key exists in the dictionary.
 * If the key does not exist in the dictionary, it adds the key-value pair to the dictionary with the value as -value.
 *
 * @param dictionary The dictionary to be updated.
 * @param key The key to be used for updating the dictionary.
 * @param value The value to be subtracted from the existing value associated with the key.
 * @return The updated dictionary.
 */
fun updateDictionary(dictionary: MutableMap<Any, Int>, key: Any, value: Int): MutableMap<Any, Int> {
/**
 * This function takes a dictionary and updates it by subtracting the value from the existing value associated with the key, if the key exists in the dictionary.
 * If the key does not exist in the dictionary, it adds the key-value pair to the dictionary with the value as -value.
 *
 * @param dictionary The dictionary to be updated.
 * @param key The key to be used for updating the dictionary.
 * @param value The value to be subtracted from the existing value associated with the key.
 * @return The updated dictionary.
 */
fun updateDictionary(dictionary: MutableMap<Any, Int>, key: Any, value: Int): MutableMap<Any, Int> {

    if (key in dictionary) {
        dictionary[key] = dictionary[key]!! - value
    } else {
        dictionary[key] = -value
    }
    return dictionary
}