/**
 * Given a dictionary, perform specific dictionary methods.
 *
 * @param dictionary A dictionary.
 * @return Modified dictionary after performing dictionary methods.
 */
fun dictionaryMethods(dictionary: MutableMap<String, String>): MutableMap<String, String> {

    // Removing an item from a dictionary using 'remove' method
    dictionary.remove("key1")

    // Adding a new key-value pair to the dictionary
    dictionary["key4"] = "value4"

    // Updating the value of a key in the dictionary
    dictionary["key2"] = "new_value2"

    // Retrieving all keys in the dictionary
    val keys = dictionary.keys

    return dictionary
}

// Accessing elements with nested index and dictionary methods
/**
 * Given a dictionary, perform specific dictionary methods.
 *
 * @param dictionary A dictionary.
 * @return Modified dictionary after performing dictionary methods.
 */
fun dictionaryMethods(dictionary: MutableMap<String, String>): MutableMap<String, String> {
/**
 * Given a dictionary, perform specific dictionary methods.
 *
 * @param dictionary A dictionary.
 * @return Modified dictionary after performing dictionary methods.
 */
fun dictionaryMethods(dictionary: MutableMap<String, String>): MutableMap<String, String> {

    // Removing an item from a dictionary using 'remove' method
    dictionary.remove("key1")

    // Adding a new key-value pair to the dictionary
    dictionary["key4"] = "value4"

    // Updating the value of a key in the dictionary
    dictionary["key2"] = "new_value2"

    // Retrieving all keys in the dictionary
    val keys = dictionary.keys

    return dictionary
}

// Accessing elements with nested index and dictionary methods