/**
 * You are given two dictionaries dict_1 and dict_2.
 * Your task is to iterate through all the keys in dict_1 while updating the values in dict_2 to the product of the
 * corresponding values in dict_1 and dict_2.
 *
 * In other words, for every key in dict_1, you need to multiply the value in dict_2 with the value in dict_1
 * corresponding to that key and update dict_2 with the new value for that key.
 *
 * Your code should return the updated dict_2.
 */
fun updateDictWithWhileLoop(dict1: MutableMap<String, Int>, dict2: MutableMap<String, Int>): MutableMap<String, Int> {

    val keys = dict1.keys.toMutableList() // Get all the keys from dict_1

    while (keys.isNotEmpty()) {
        val key = keys.removeAt(keys.size - 1) // Pop the last key from the keys list

        // Update the value in dict_2 with the product of corresponding values in dict_1 and dict_2
        dict2[key] = dict2[key]!! * dict1[key]!!
    }

    return dict2
}
/**
 * You are given two dictionaries dict_1 and dict_2.
 * Your task is to iterate through all the keys in dict_1 while updating the values in dict_2 to the product of the
 * corresponding values in dict_1 and dict_2.
 *
 * In other words, for every key in dict_1, you need to multiply the value in dict_2 with the value in dict_1
 * corresponding to that key and update dict_2 with the new value for that key.
 *
 * Your code should return the updated dict_2.
 */
fun updateDictWithWhileLoop(dict1: MutableMap<String, Int>, dict2: MutableMap<String, Int>): MutableMap<String, Int> {
/**
 * You are given two dictionaries dict_1 and dict_2.
 * Your task is to iterate through all the keys in dict_1 while updating the values in dict_2 to the product of the
 * corresponding values in dict_1 and dict_2.
 *
 * In other words, for every key in dict_1, you need to multiply the value in dict_2 with the value in dict_1
 * corresponding to that key and update dict_2 with the new value for that key.
 *
 * Your code should return the updated dict_2.
 */
fun updateDictWithWhileLoop(dict1: MutableMap<String, Int>, dict2: MutableMap<String, Int>): MutableMap<String, Int> {

    val keys = dict1.keys.toMutableList() // Get all the keys from dict_1

    while (keys.isNotEmpty()) {
        val key = keys.removeAt(keys.size - 1) // Pop the last key from the keys list

        // Update the value in dict_2 with the product of corresponding values in dict_1 and dict_2
        dict2[key] = dict2[key]!! * dict1[key]!!
    }

    return dict2
}