100 atcoder#ABC177B. [ABC177B] Substring
[ABC177B] Substring
Score : points
Problem Statement
Given are two strings and .
Let us change some of the characters in so that will be a substring of .
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 and are each at least and at most .
- The length of is at most that of .
- and consist of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of characters in that need to be changed.
cabacc
abc
1
For example, changing the fourth character a
in to c
will match the second through fourth characters in to .
Since itself does not have as its substring, this number of changes - one - is the minimum needed.
codeforces
atcoder
6