I have two immutable maps, as example:
val a = mapOf("a" to 1, "z" to 1)
val b = mapOf("b" to 1, "a" to 1, "c" to 1)
Is there any elegant way to concatenate these maps and have a single map with all the keys? If it has duplicated keys, I want to replace it with value from B map.
The result should look something like:
mapOf("z" to 1, "b" to 1, "a" to 1, "c" to 1)