#abc342a. A - Yay!
A - Yay!
Score: points
问题描述
你将得到一个由小写英文字母组成的字符串 。字符串 的长度介于 到 (包含两端点)之间。
中除一个字符外,所有其他字符都相同。
请找出索引为 的字符,该字符与 中的其他所有字符不同。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string consisting of lowercase English letters. The length of is between and , inclusive.
All characters but one of are the same.
Find such that the -th character of differs from all other characters.
Constraints
- is a string of length between and , inclusive, consisting of two different lowercase English letters.
- All characters but one of are the same.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
yay
Sample Output 1
2
The second character of yay
differs from the first and third characters.
Sample Input 2
egg
Sample Output 2
1
Sample Input 3
zzzzzwz
Sample Output 3
6
update @ 2024/3/10 01:35:45