Bob and String : HackerEarth Problem Solution

Bob and Khatu both love the string. Bob has a string S and Khatu has a string T. They want to make both string S and T to anagrams of each other. Khatu can apply two operations to convert string T to anagram of string S which are given below:
1.) Delete one character from the string T.
2.) Add one character from the string S.



Khatu can apply above both operation as many times he want. Find the minimum number of operations required to convert string T so that both T and S will become anagram of each other.


Input:


First line of input contains number of test cases T. Each test case contains two lines. First line contains string S and second line contains string T.


Output:


For each test case print the minimum number of operations required to convert string T to anagram of string S.


Constraints:


1 ≤ T ≤ 10

1 ≤ |S|,|T| ≤ 105

SAMPLE INPUT 


4

abc
cba
abd
acb
talentpad
talepdapd
code
road

SAMPLE OUTPUT 


0

2
4
4

Implementation:


#include<stdio.h>
int main()
{
     int t;
     char *s,*v;
     int i;
     int hashs[26],hashv[26];
     int count;
     s = (char*)malloc(sizeof(char)*1000000);
     v = (char*)malloc(sizeof(char)*1000000);
     scanf("%d",&t);
     while(t--)
     {
          memset(hashs,0,sizeof(hashs));
          memset(hashv,0,sizeof(hashv));
          count = 0;
          scanf("%s",s);
          scanf("%s",v);
          i=0;
          while(*(s+i))
               hashs[*(s+i)-'a']++,i++;
          i=0;
          while(*(v+i))
               hashv[*(v+i)-'a']++,v++;
          i=0;
          while(i<26)
          {
               if(hashs[i]!=hashv[i])
               {
                    count += abs(hashs[i]-hashv[i]);
               }
               i++;
          }
          printf("%d\n",count);
     }
     return 0;
}