Extra Character

AtCoder
IDabc280_c
Time2000ms
Memory256MB
Difficulty
You are given strings $S$ and $T$. $S$ consists of lowercase English letters, and $T$ is obtained by inserting a lowercase English letter into $S$. Find the position of the inserted character in $T$. If there are multiple candidates, find any of them. ## Constraints * $1 \leq |S| \leq 5\times 10^5$ * $S$ consists of lowercase English letters. * $T$ is obtained by inserting a lowercase English letter into $S$. ## Input The input is given from Standard Input in the following format: $S$ $T$ [samples]
Samples
Input #1
atcoder
atcorder
Output #1
5

The $5$\-th character from the beginning of $T$, `r`, is inserted.
Input #2
million
milllion
Output #2
5

One of the $3$\-rd, $4$\-th, and $5$\-th characters from the beginning of $T$ is inserted. Thus, printing any one of $3$, $4$, and $5$ is accepted.
Input #3
vvwvw
vvvwvw
Output #3
3
API Response (JSON)
{
  "problem": {
    "name": "Extra Character",
    "description": {
      "content": "You are given strings $S$ and $T$. $S$ consists of lowercase English letters, and $T$ is obtained by inserting a lowercase English letter into $S$. Find the position of the inserted character in $T$. ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc280_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given strings $S$ and $T$. $S$ consists of lowercase English letters, and $T$ is obtained by inserting a lowercase English letter into $S$.\nFind the position of the inserted character in $T$. ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments