1401. Easy String Problem

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

输入

The first line is a positive integer N (2N106)N \ (2≤N≤10^6), which represents the length of the string.The second and third lines each have a string of length NN , which represent sting AA and string BB 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