/**
 * Given a dictionary, this function will modify the values of certain keys based on the precedence of logical operators.
 *
 * @param dictionary Input dictionary with key-value pairs
 * @return Updated dictionary with modified values
 */
fun updateDict(dictionary: MutableMap<String, Int>): MutableMap<String, Int> {

    // Initialize a list of keys to be modified
    val keysToModify = mutableListOf<String>()

    // Find keys in the dictionary where the values meet certain conditions
    for ((key, value) in dictionary) {
        // Condition: The value should be greater than 10 and less than or equal to 20, or the value should be less than 5
        if ((value > 10 && value <= 20) || (value < 5)) {
            keysToModify.add(key)
        }
    }

    // Modify the values of the selected keys using precedence of logical operators
    for (key in keysToModify) {
        // Condition: If the value is less than 5, add 3 to it; otherwise, subtract 2 from it
        dictionary[key] = if (dictionary[key]!! < 5) dictionary[key]!! + 3 else dictionary[key]!! - 2
    }

    return dictionary
}
/**
 * Given a dictionary, this function will modify the values of certain keys based on the precedence of logical operators.
 *
 * @param dictionary Input dictionary with key-value pairs
 * @return Updated dictionary with modified values
 */
fun updateDict(dictionary: MutableMap<String, Int>): MutableMap<String, Int> {
/**
 * Given a dictionary, this function will modify the values of certain keys based on the precedence of logical operators.
 *
 * @param dictionary Input dictionary with key-value pairs
 * @return Updated dictionary with modified values
 */
fun updateDict(dictionary: MutableMap<String, Int>): MutableMap<String, Int> {

    // Initialize a list of keys to be modified
    val keysToModify = mutableListOf<String>()

    // Find keys in the dictionary where the values meet certain conditions
    for ((key, value) in dictionary) {
        // Condition: The value should be greater than 10 and less than or equal to 20, or the value should be less than 5
        if ((value > 10 && value <= 20) || (value < 5)) {
            keysToModify.add(key)
        }
    }

    // Modify the values of the selected keys using precedence of logical operators
    for (key in keysToModify) {
        // Condition: If the value is less than 5, add 3 to it; otherwise, subtract 2 from it
        dictionary[key] = if (dictionary[key]!! < 5) dictionary[key]!! + 3 else dictionary[key]!! - 2
    }

    return dictionary
}