Concept Flow - Merge and update methods
Start with Hash A and Hash B
Call merge or update on Hash A with Hash B
For each key in Hash B
If key exists in A?
Yes→Replace value in A
Add key-value to A
Return new Hash (merge) or modify A (update)
End
Start with two hashes. For each key in the second hash, add or replace the key-value in the first hash. Merge returns a new hash; update changes the original.