title: minimum number of character deletions (of both) required to turn these strings into anagrams?
body: <p>Two strings are given,how many minimum number of character deletions (of both) required to turn these strings into anagrams.
  Constraint: Need to use single hash</p>
  
  <p>aaabbc abc</p>
  
  <p>Output - 3 ( 2 a and 1 b)</p>
  
  <p>I was able to achieve this using two hashes and tried below solution using one hash -</p>
  
  <pre><code>my $str1 = 'aaabbc';
  my $str2 = 'abc';
  
  my %h;
  
  map{$h{$_}++} sort(//,$str1);
  map{$h{$_}++} sort(//,$str2);
  
  my $c = 0;
  
  foreach (keys(%h)) {
      if($h{$_} == 1) {
          $c++;
      }
  }
  
  print "$c\n";
  </code></pre>
  
  <p>It will fail in many case like ('xxx', 'yyy').
  Any suggestions?</p>