title: Kotlin - How to concatenate two maps?
body: <p>I have two immutable maps, as example:</p>
  <pre><code>val a = mapOf(&quot;a&quot; to 1, &quot;z&quot; to 1)
  val b = mapOf(&quot;b&quot; to 1, &quot;a&quot; to 1, &quot;c&quot; to 1)
  </code></pre>
  <p>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.</p>
  <p>The result should look something like:</p>
  <pre><code>mapOf(&quot;z&quot; to 1, &quot;b&quot; to 1, &quot;a&quot; to 1, &quot;c&quot; to 1)
  </code></pre>