title: Dictionary subtract issue for its similar array element
body: <p>I am trying to subtract two JSON/Dictionary. But the dictionary containing an array of objects is not working properly. Demo examples are given below. My intention is to prepare a new JSON file that property does not exist in the default JSON file. That is for the country-specific configuration I want to put into the new file.</p>
  <p>[NOTE: If the value is different in any key of two dictionaries it should not be subtracted and we will consider the first dictionary value for the key. If the item is the same in any array then those similar array items should be removed. That is my main intention. I think it is clear now.]</p>
  <pre><code>    let dict1 = [
          &quot;FALLBACK&quot;: &quot;en-GB&quot;,
          &quot;SUPPORTED&quot;: [
              &quot;en-GB&quot;,
              &quot;fr&quot;,
              &quot;de&quot;,
              &quot;es&quot;,
              &quot;it&quot;,
              &quot;hu&quot;,
              &quot;nl&quot;,
              &quot;pl&quot;,
              &quot;sv&quot;,
              &quot;tr&quot;,
              &quot;ru&quot;,
              &quot;da&quot;,
              &quot;cs&quot;,
              &quot;fi&quot;,
              &quot;nb&quot;,
              &quot;pt&quot;,
              &quot;sr&quot;
          ]
      ]
  
      let dict2 = [
          &quot;FALLBACK&quot;: &quot;fr&quot;,
          &quot;SUPPORTED&quot;: [
              &quot;en-GB&quot;,
              &quot;fr&quot;,
              &quot;de&quot;,
              &quot;es&quot;,
              &quot;it&quot;,
              &quot;hu&quot;,
              &quot;nl&quot;,
              &quot;pl&quot;,
              &quot;sv&quot;,
              &quot;tr&quot;,
              &quot;ru&quot;,
              &quot;da&quot;,
              &quot;cs&quot;,
              &quot;fi&quot;,
              &quot;nb&quot;,
              &quot;pt&quot;,
              &quot;sr&quot;,
              &quot;ar&quot;,
              &quot;bg&quot;,
              &quot;el&quot;,
              &quot;fa&quot;,
              &quot;hr&quot;,
              &quot;ka&quot;,
              &quot;lt&quot;,
              &quot;lv&quot;,
              &quot;ro&quot;,
              &quot;sk&quot;,
              &quot;sl&quot;,
              &quot;uk&quot;
          ]
      ]
  
      let diff = dict2.minus(dict: dict1)
  </code></pre>
  <p>Expected output (something like this):</p>
  <pre><code>     [
          &quot;FALLBACK&quot;: &quot;en-GB&quot;,
          &quot;SUPPORTED&quot;: [
              &quot;ar&quot;,
              &quot;bg&quot;,
              &quot;el&quot;,
              &quot;fa&quot;,
              &quot;hr&quot;,
              &quot;ka&quot;,
              &quot;lt&quot;,
              &quot;lv&quot;,
              &quot;ro&quot;,
              &quot;sk&quot;,
              &quot;sl&quot;,
              &quot;uk&quot;
          ]
      ]
  </code></pre>
  <p>I followed this subtraction function. All are fine but the problem is during array subtraction.</p>
  <pre><code>extension Dictionary where Key: Comparable, Value: Equatable {
      func minus(dict: [Key:Value]) -&gt; [Key:Value] {
          let entriesInSelfAndNotInDict = filter { dict[$0.0] != self[$0.0] }
          return entriesInSelfAndNotInDict.reduce([Key:Value]()) { (res, entry) -&gt; [Key:Value] in
              var res = res
              res[entry.0] = entry.1
              return res
          }
      }
  }
  </code></pre>