/**
 * This function takes a dictionary and a key as input and performs subtraction assignment operation.
 * It subtracts the value of the given key from the corresponding value in the dictionary.
 *
 * @param dictionary The dictionary on which subtraction assignment operation is performed.
 * @param key The key for which the value needs to be subtracted.
 * @return The updated dictionary after performing subtraction assignment operation.
 */
fun subtractAssignmentOperator(dictionary: MutableMap<String, Int>, key: String): MutableMap<String, Int> {

    try {
        dictionary[key] = dictionary.getOrDefault(key, 0) - dictionary.getOrDefault(key, 0)
    } catch (e: Exception) {
        when (e) {
            is NoSuchElementException -> println("The key '$key' doesn't exist in the dictionary.")
            else -> println("An error occurred: $e")
        }
    }
    return dictionary
}

// Example usage
/**
 * This function takes a dictionary and a key as input and performs subtraction assignment operation.
 * It subtracts the value of the given key from the corresponding value in the dictionary.
 *
 * @param dictionary The dictionary on which subtraction assignment operation is performed.
 * @param key The key for which the value needs to be subtracted.
 * @return The updated dictionary after performing subtraction assignment operation.
 */
fun subtractAssignmentOperator(dictionary: MutableMap<String, Int>, key: String): MutableMap<String, Int> {
/**
 * This function takes a dictionary and a key as input and performs subtraction assignment operation.
 * It subtracts the value of the given key from the corresponding value in the dictionary.
 *
 * @param dictionary The dictionary on which subtraction assignment operation is performed.
 * @param key The key for which the value needs to be subtracted.
 * @return The updated dictionary after performing subtraction assignment operation.
 */
fun subtractAssignmentOperator(dictionary: MutableMap<String, Int>, key: String): MutableMap<String, Int> {

    try {
        dictionary[key] = dictionary.getOrDefault(key, 0) - dictionary.getOrDefault(key, 0)
    } catch (e: Exception) {
        when (e) {
            is NoSuchElementException -> println("The key '$key' doesn't exist in the dictionary.")
            else -> println("An error occurred: $e")
        }
    }
    return dictionary
}

// Example usage