Bob and String
Practice
3.7 (50 votes)
Approved
Basic programming
Easy
Hash maps
Open
Problem
88% Success 15438 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code

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

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
16 votes
Tags:
Data StructuresEasyHash MapsHash Tables
Points:20
16 votes
Tags:
Accessing MapsData StructuresEasyHash TablesImplementationPriority queueString Manipulation
Points:20
34 votes
Tags:
Ad-HocAlgorithmsApprovedEasyOpen