#abc280c. C - Extra Character

C - Extra Character

Score : 300300 points

问题描述

你将获得两个字符串 SSTT。其中,SS 由小写英文字母组成,而 TT 是在 SS 中插入一个小写英文字母后得到的。

要求找出在 TT 中插入字符的位置。 如果有多个可能的位置,则找到任意一个即可。

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

Problem Statement

You are given strings SS and TT. SS consists of lowercase English letters, and TT is obtained by inserting a lowercase English letter into SS.

Find the position of the inserted character in TT.
If there are multiple candidates, find any of them.

Constraints

  • 1S5×1051 \leq |S| \leq 5\times 10^5
  • SS consists of lowercase English letters.
  • TT is obtained by inserting a lowercase English letter into SS.

Input

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

SS

TT

Output

Print an integer ii, representing that the inserted character is the ii-th character from the beginning of TT. If there are multiple possible answers, printing any of them is accepted.

Sample Input 1

atcoder
atcorder

Sample Output 1

5

The 55-th character from the beginning of TT, r, is inserted.

Sample Input 2

million
milllion

Sample Output 2

5

One of the 33-rd, 44-th, and 55-th characters from the beginning of TT is inserted. Thus, printing any one of 33, 44, and 55 is accepted.

Sample Input 3

vvwvw
vvvwvw

Sample Output 3

3

update @ 2024/3/10 11:46:04