BETA

Difficulty Level: Basic

Submissions: 1905 Accuracy:

35.85%

Anagram of String (Function Problem)
       

Given two strings in lowercase, the task is to make them anagram. The only allowed operation is to remove a character from any string. Find minimum number of characters to be deleted to make both the strings anagram. If two strings contains same data set in any order then strings are called Anagrams.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of 2 strings to make the anagrams.

Output:
Output the minimum number of characters to be deleted to make both the strings anagram.

Constraints:
1<=T<=10^5
1<=length of string<=10^5

Example:
Input:

2
bcadeh
hea
cddgk
gcd

Output:
3
2

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil


					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.