Company: Google
Difficulty: medium
Minimize the cost Max. score: 20.00 You are given two strings S and R, each of size N, containing lowercase English letters. You can do the following operations any number of times: Type 0: Select any two indices i and j from 0 to n-1 and swap S[i] with S[j]. This operation is free of cost. Type 1: Select any index i from 0 to n-1 and swap S[i] with any lowercase English letter. This operation costs 1 coin. Task Determine the minimum cost to make string S equal to R. Note: 0-based indexing is followed. Input Format The first line contains an integer T denoting the number of test cases. For each test case: The first line contains N denoting the size of the strings S and R. The second line contains the string S. The third line contains the string R. Output Format For each test case in a new line, print an integer representing the minimum cost to make string S equal to R. Constraints 1 ≤ T ≤ 5 1 ≤ N ≤ 10 5 S and R contains only lowercase English letters Example Assumptions: N = 5 S = \"ab