Task Description
輸入四個1~9不重複的數字,輸出𝑥A𝑦B,
其中𝑥表示數字與位置皆相同的個數,𝑦表示數字相同但位置不同的個數。
答案為1234,若輸入0243,則輸出1A2B。
若輸入其他字元,或輸入未滿4個數字,則輸出Invalid input。
Input Format
輸入四個數字。
Output Format
輸出𝑥A𝑦B。
Sample Input
0243
Sample Output
1A2B
Sample Input
@#$%
Sample Output
Invalid input