/**
 * Given a dictionary, this function iterates through each key-value pair,
 * and modifies the value by multiplying it with its corresponding key.
 *
 * @param dictionary A dictionary containing key-value pairs.
 * @return The modified dictionary with updated values.
 *
 * Example:
 * Input:
 * dictionary = mapOf('A' to 3, 'B' to 2, 'C' to 1)
 *
 * Output:
 * mapOf('A' to 3, 'B' to 4, 'C' to 3)
 *
 * Explanation:
 * The value '3' which corresponds to key 'A' remains unchanged because '3 * 1' is also '3'.
 * The value '2' which corresponds to key 'B' is updated to '2 * 2' which is '4'.
 * The value '1' which corresponds to key 'C' is updated to '1 * 3' which is '3'.
 */
fun iterateModifyDictionary(dictionary: MutableMap<String, Int>): Map<String, Int> {

    for ((key, value) in dictionary) {
        dictionary[key] = value * key.toInt()
    }
    return dictionary
}
/**
 * Given a dictionary, this function iterates through each key-value pair,
 * and modifies the value by multiplying it with its corresponding key.
 *
 * @param dictionary A dictionary containing key-value pairs.
 * @return The modified dictionary with updated values.
 *
 * Example:
 * Input:
 * dictionary = mapOf('A' to 3, 'B' to 2, 'C' to 1)
 *
 * Output:
 * mapOf('A' to 3, 'B' to 4, 'C' to 3)
 *
 * Explanation:
 * The value '3' which corresponds to key 'A' remains unchanged because '3 * 1' is also '3'.
 * The value '2' which corresponds to key 'B' is updated to '2 * 2' which is '4'.
 * The value '1' which corresponds to key 'C' is updated to '1 * 3' which is '3'.
 */
fun iterateModifyDictionary(dictionary: MutableMap<String, Int>): Map<String, Int> {
/**
 * Given a dictionary, this function iterates through each key-value pair,
 * and modifies the value by multiplying it with its corresponding key.
 *
 * @param dictionary A dictionary containing key-value pairs.
 * @return The modified dictionary with updated values.
 *
 * Example:
 * Input:
 * dictionary = mapOf('A' to 3, 'B' to 2, 'C' to 1)
 *
 * Output:
 * mapOf('A' to 3, 'B' to 4, 'C' to 3)
 *
 * Explanation:
 * The value '3' which corresponds to key 'A' remains unchanged because '3 * 1' is also '3'.
 * The value '2' which corresponds to key 'B' is updated to '2 * 2' which is '4'.
 * The value '1' which corresponds to key 'C' is updated to '1 * 3' which is '3'.
 */
fun iterateModifyDictionary(dictionary: MutableMap<String, Int>): Map<String, Int> {

    for ((key, value) in dictionary) {
        dictionary[key] = value * key.toInt()
    }
    return dictionary
}