題目來源:judgegirl from ntu prof. pangfeng Liu
Task Description
Determine the and values for two input numbers.
You have two numbers, each consisting of 4 different digits from 1 to 9.
You should determine two values.
The value is the number of digits that are the same and appear in the same locations.
For example, the value of 1234
and 1253
is two since both 1 and 2 are the same and appear in the same locations.
The value is the number of digits that are the same but appear in different locations.
For example, the value of 1234
and 1253
is 1, since 3 appears in both numbers but appears in different locations.
Input Format
Two numbers in a line to determine the and values. Both numbers consist of 4 different non-zero digits.
Output Format
A single string of n A m B
where is the value and is the value determined for the input.
Sample Input
1234 1345
Sample Output
1A2B