Question: Given two maps, Map, merge the two into a new map, Map where keys in Map 2 , * and their Integer values, are added

Given two maps, Map, merge the two into a new map, Map where keys in Map2,
* and their Integer values, are added to the Integer values of matching keys in Map1. Return the new map.
*
* Unmatched keys and their Integer values in Map2 are simply added to Map1.
*
* consolidateInventory({"SKU1": 100, "SKU2": 53, "SKU3": 44}{"SKU2":11, "SKU4": 5})
*->{"SKU1": 100, "SKU2": 64, "SKU3": 44, "SKU4": 5}
*

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!