Leaderboard
Showing:
Almost Equal
Easy Accuracy: 31.74% Submissions: 9582 Points: 2

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.

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Almost Equal

Output Window