Substring 2

AtCoder
IDabc196_f
Time3000ms
Memory256MB
Difficulty
Given are strings $S$ and $T$ consisting of `0` and `1`. We will change some of the characters in $T$ so that $T$ becomes a substring of $S$. How many characters do we need to change at least? What is a substring? $T$ is said to be a substring of $S$ when some contiguous part of $S$ matches $T$. For example, `000` is a substring of `10001`, while `11` is not. ## Constraints * Each of $S$ and $T$ consists of `0` and `1`. * $1 ≤ |T| ≤ |S| ≤ 10^6$ ## Input Input is given from Standard Input in the following format: $S$ $T$ [samples]
Samples
Input #1
0001
101
Output #1
1

Changing $T$ to `001` makes it match the $2$\-nd through $4$\-th characters of $S$.
Input #2
0101010
1010101
Output #2
7
Input #3
10101000010011011110
0010011111
Output #3
1
API Response (JSON)
{
  "problem": {
    "name": "Substring 2",
    "description": {
      "content": "Given are strings $S$ and $T$ consisting of `0` and `1`.   We will change some of the characters in $T$ so that $T$ becomes a substring of $S$.   How many characters do we need to change at least? Wha",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 3000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc196_f"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given are strings $S$ and $T$ consisting of `0` and `1`.  \nWe will change some of the characters in $T$ so that $T$ becomes a substring of $S$.  \nHow many characters do we need to change at least?\nWha...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments