#abc342a. A - Yay!

A - Yay!

Score: 150150 points

问题描述

你将得到一个由小写英文字母组成的字符串 SS。字符串 SS 的长度介于 33100100(包含两端点)之间。

SS 中除一个字符外,所有其他字符都相同。

请找出索引为 xx 的字符,该字符与 SS 中的其他所有字符不同。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a string SS consisting of lowercase English letters. The length of SS is between 33 and 100100, inclusive.

All characters but one of SS are the same.

Find xx such that the xx-th character of SS differs from all other characters.

Constraints

  • SS is a string of length between 33 and 100100, inclusive, consisting of two different lowercase English letters.
  • All characters but one of SS are the same.

Input

The input is given from Standard Input in the following format:

SS

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