Typing

AtCoder
IDabc352_b
Time2000ms
Memory256MB
Difficulty
Takahashi tried to type a string $S$ 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 $T$. He did not mistakenly press any keys other than those for lowercase English letters. The characters in $T$ that were not mistakenly typed are called **correctly typed characters**. Determine the positions in $T$ of the correctly typed characters. ## Constraints * $S$ and $T$ are strings of lowercase English letters with lengths between $1$ and $2 \times 10^5$, inclusive. * $T$ is a string obtained by the procedure described in the problem statement. ## Input The input is given from Standard Input in the following format: $S$ $T$ [samples]
Samples
Input #1
abc
axbxyc
Output #1
1 3 6

The sequence of Takahashi's typing is as follows:

*   Type `a`.
*   Try to type `b` but mistakenly type `x`.
*   Press the backspace key, but the character is not deleted.
*   Type `b`.
*   Try to type `c` but mistakenly type `x`.
*   Press the backspace key, but the character is not deleted.
*   Try to type `c` but mistakenly type `y`.
*   Press the backspace key, but the character is not deleted.
*   Type `c`.

The correctly typed characters are the first, third, and sixth characters.
Input #2
aaaa
bbbbaaaa
Output #2
5 6 7 8
Input #3
atcoder
atcoder
Output #3
1 2 3 4 5 6 7

Takahashi did not mistakenly type any characters.
API Response (JSON)
{
  "problem": {
    "name": "Typing",
    "description": {
      "content": "Takahashi tried to type a string $S$ 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 differen",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc352_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Takahashi tried to type a string $S$ consisting of lowercase English letters using a keyboard.\nHe was typing while looking only at the keyboard, not the screen.\nWhenever he mistakenly typed a differen...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments