409601: GYM103643 D Sticky Spelling Situation

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Sticky Spelling Situationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given two strings of equal length, $$$A$$$ and $$$B$$$. Two strings are considered $$$\small \textit{alike}$$$ if they contain the same count of each letter they possess. Note that two strings can be $$$\small \textit{alike}$$$ even if they are not exactly equal. Your goal is to find the minimum number of letters that need to be changed in $$$A$$$ in order for the two strings to be considered $$$\small \textit{alike}$$$.

Input

The first line of input will be an integer $$$N$$$ ($$$1 \leq N \leq 10^4$$$), denoting the length of both of the strings.

Then the next two lines will contain two lowercase space-separated strings $$$A$$$ and $$$B$$$.

Output

The output should be an integer representing the minimum number of letters needing to be changed in $$$A$$$ for the two strings to be considered $$$\small \textit{alike}$$$.

ExampleInput
5
abced abcdf
Output
1
Note

The string $$$\text{abced}$$$ and $$$\text{abcdf}$$$ have one character they don't have in common, which is $$$\text{e}$$$. Therefore, only one change is necessary for $$$\text{abced}$$$ and $$$\text{abcdf}$$$ to be considered $$$\small \textit{alike}$$$: change $$$\text{e}$$$ to an $$$\text{f}$$$.

$$$---------------------------------------------$$$

Problem Idea: Spark

Problem Preparation: Spark

Occurrences: Novice 3

加入题单

上一题 下一题 算法标签: