AtCoder Beginner Contest 177
B
Substring
AtCoder
⌀ 108
原题
← AC →
翻译中…

Problem Statement

翻译中…

Given are two strings $S$ and $T$.

翻译中…

Let us change some of the characters in $S$ so that $T$ will be a substring of $S$.

翻译中…

At least how many characters do we need to change?

翻译中…

Here, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.

翻译中…

Constraints

翻译中…
  • The lengths of $S$ and $T$ are each at least $1$ and at most $1000$.
  • The length of $T$ is at most that of $S$.
  • $S$ and $T$ consist of lowercase English letters.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S
T

翻译中…

Output

翻译中…

Print the minimum number of characters in $S$ that need to be changed.

翻译中…

样例

Input #1
cabacc
abc
Output #1
1
For example, changing the fourth character `a` in $S$ to `c` will match the second through fourth characters in $S$ to $T$. Since $S$ itself does not have $T$ as its substring, this number of changes - one - is the minimum needed.
Input #2
codeforces
atcoder
Output #2
6
题目信息
题号
abc177_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。