102211: [AtCoder]ABC221 B - typo
Description
Score : $200$ points
Problem Statement
You are given two strings $S$ and $T$. Determine whether it is possible to make $S$ and $T$ equal by doing the following operation at most once:
- choose two adjacent characters in $S$ and swap them.
Note that it is allowed to choose not to do the operation.
Constraints
- Each of $S$ and $T$ is a string of length between $2$ and $100$ (inclusive) consisting of lowercase English letters.
- $S$ and $T$ have the same length.
Input
Input is given from Standard Input in the following format:
$S$ $T$
Output
If it is possible to make $S$ and $T$ equal by doing the operation in Problem Statement at most once, print Yes
; otherwise, print No
.
Sample Input 1
abc acb
Sample Output 1
Yes
You can swap the $2$-nd and $3$-rd characters of $S$ to make $S$ and $T$ equal.
Sample Input 2
aabb bbaa
Sample Output 2
No
There is no way to do the operation to make $S$ and $T$ equal.
Sample Input 3
abcde abcde
Sample Output 3
Yes
$S$ and $T$ are already equal.
Input
题意翻译
有两个字符串 $s,t$ 。你可以将 $s$ 中的某两个字符进行交换**一次**,也可以什么都不做。问:操作完成后, $s$ 是否可以与 $t$ 一致?Output
问题描述
给你两个字符串$S$和$T$。确定是否可以通过以下操作最多一次使$S$和$T$相等:
- 选择$S$中的两个相邻字符并交换它们。
注意可以选择不做该操作。
约束
- $S$和$T$都是长度在$2$到$100$(含)之间的由小写英文字母组成的字符串。
- $S$和$T$具有相同的长度。
输入
从标准输入以以下格式获取输入:
$S$ $T$
输出
如果可以通过在问题描述中的操作最多执行一次使$S$和$T$相等,则打印Yes
;否则,打印No
。
样例输入 1
abc acb
样例输出 1
Yes
你可以交换$S$的第$2$个和第$3$个字符以使$S$和$T$相等。
样例输入 2
aabb bbaa
样例输出 2
No
没有方法通过执行该操作使$S$和$T$相等。
样例输入 3
abcde abcde
样例输出 3
Yes
$S$和$T$已经相等。