Almost Equal
Submissions: 4778   Accuracy:

21.86%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Fork CPP

Given two strings S1 and S2 consisting of only lowercase characters whose anagrams are almost equal. The task is to count the number of characters which needs to be edited(delete) to make S1 equal to S2.

Input:
For each testcase, first line of input contains number of testcase T. For each testcase, there will be two lines containing string S1 and S2.

Output:
For each testcase, print the count of characters needed to delete to make S1 and S2 equal.

Constraints:
1 <= T <= 100
1 <= S1, S2 <= 104

Example:
Input:

1
madame
madam

Output:
1

Explanation:
Testcase 1:
String S1 = madame, string S2 = madam. character 'e' in first string needs to be deleted to make S1 equal to S2.

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

Author: Dhiman Mayank


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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


to report an issue on this page.