1401. Easy String Problem

Given two strings A and B with the same length and composed of uppercase English letters, ensure that each letter in A and B appears the same number of times.You can exchange two adjacent characters in string A each time, find out how many times you need to exchange so that string A becomes string B.

输入

The first line is a positive integer N \ (2≤N≤10^6), which represents the length of the string.The second and third lines each have a string of length N , which represent sting A and string B and contain only uppercase letters.

输出

A nonnegative integer that represents the minimum number of exchanges.

样例

标准输入 复制文本
4
CABC
CCAB
标准输出 复制文本
2

来源

SCNUCPC 2020 现场赛

登录以提交代码。
单点时限 1 秒
内存限制 256 MB
提交 61
通过 19