You have two strings S and T. You may choose two adjacent characters in S and swap them (You can also choose to not do this swap).
Is it possible to make S into T?
The first line of input contains S
The second line of input contains T
Output 'Yes' or 'No' without the quotes
abc acb
YesWe can swap the b and c to turn abc into acb.
aabb bbaa
No
abcde abcde
YesYou can choose to not do the swap
Subtask | Score |
---|---|
1 | 100 |
2 | 0 |