#abc352b. B - Typing
B - Typing
Score: points
问题陈述
高桥尝试使用键盘输入一个由小写英文字母组成的字符串 。
他在打字时只看键盘,不看屏幕。
每当他错误地输入了一个不同的小写英文字母,他就会立即按下退格键。然而,退格键坏了,所以错误输入的字母并没有被删除,实际输入的字符串是 。
他没有错误地按下除了小写英文字母之外的任何键。
在 中没有被错误输入的字符被称为正确输入的字符。
确定 中正确输入的字符的位置。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Takahashi tried to type a string consisting of lowercase English letters using a keyboard.
He was typing while looking only at the keyboard, not the screen.
Whenever he mistakenly typed a different lowercase English letter, he immediately pressed the backspace key. However, the backspace key was broken, so the mistakenly typed letter was not deleted, and the actual string typed was .
He did not mistakenly press any keys other than those for lowercase English letters.
The characters in that were not mistakenly typed are called correctly typed characters.
Determine the positions in of the correctly typed characters.
Constraints
- and are strings of lowercase English letters with lengths between and , inclusive.
- is a string obtained by the procedure described in the problem statement.
Input
The input is given from Standard Input in the following format:
Output
Let be the length of . If the correctly typed characters are the -th, -th, , -th characters of , print the values of in this order, separated by spaces.
Ensure that the output is in ascending order. That is, should hold for each .
Sample Input 1
abc
axbxyc
Sample Output 1
1 3 6
The sequence of Takahashi's typing is as follows:
- Type
a
. - Try to type
b
but mistakenly typex
. - Press the backspace key, but the character is not deleted.
- Type
b
. - Try to type
c
but mistakenly typex
. - Press the backspace key, but the character is not deleted.
- Try to type
c
but mistakenly typey
. - Press the backspace key, but the character is not deleted.
- Type
c
.
The correctly typed characters are the first, third, and sixth characters.
Sample Input 2
aaaa
bbbbaaaa
Sample Output 2
5 6 7 8
Sample Input 3
atcoder
atcoder
Sample Output 3
1 2 3 4 5 6 7
Takahashi did not mistakenly type any characters.