Alice sends a data packet two times to Bob. Let A and B are the strings of lowercase letters that represent the packets received by Bob. Bob compares the packets and accepts them only if he can swap two letters in A so that the result is equal to B. Now you are asked to help Bob in determing whether the packets can be accepted or not. Print 1 if the packets are acceptable or else print 0.
Input Format
A,B - Two strings of lowercase letters
Constraints
0<=len(A)<=100
0<=len(B)<=100
Output Format
Print 1 if packets are acceptable otherwise print 0
Sample Input 0
ab
ba
Sample Output 0
1
Explanation 0
You can swap A[0] = 'a' and A[1] = 'b' to get "ba", which is equal to B.
Sample Input 1
ab
ab
Sample Output 1
0
Explanation 1
The only letters you can swap are A[0] = 'a' and A[1] = 'b', which results in "ba" != B.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |