title: How to get the count of unmatched character in two strings?
body: <p>I need to get the count of Unmatched character in two strings. for example </p>
  
  <pre><code>string 1 "hari", string 2 "malar"
  </code></pre>
  
  <p>Now i need to remove the duplicates from both string ['a' &amp; 'r'] are common in both strings so remove that, now <strong>string 1 contain "hi" string 2 contain "mla"</strong>.</p>
  
  <p>Remaining <strong>count = 5</strong></p>
  
  <p>I tried this code, its working fine if duplicate / repeart is not available in same sting like here 'a' come twice in <strong>string 2</strong> so my code is didn't work properly.</p>
  
  <pre><code>for (int i = 0; i &lt; first.length; i++) {
                  for (int j = 0; j &lt; second.length; j++) {
  
                      if(first[i] == second[j])
                      {
                          getstrings = new ArrayList&lt;String&gt;();
                          count=count+1;
                          Log.d("Matches", "string char that matched "+ first[i] +"==" + second[j]);                          
                      }
                  }
              }
              int tot=(first.length + second.length) - count;
  </code></pre>
  
  <p>here first &amp; second refers to </p>
  
  <pre><code>char[] first  = nameone.toCharArray();
  char[] second = nametwo.toCharArray();
  </code></pre>
  
  <p>this code is working fine for <code>String 1 "sri" string 2 "hari"</code> here in a string character didn't repeat so this above code is working fine. Help me to solve this ?</p>