occasion will be here soon. Mr. Chanek needs to enliven his home's divider with decorations. The divider can be addressed as a double string an of length n. His #1 nephew has one more double string b of length m (m≤n). Mr. Chanek's
Write code and output screenshot. Correct answer will upvoted else downvoted.
Winter occasion will be here soon. Mr. Chanek needs to enliven his home's divider with decorations. The divider can be addressed as a double string an of length n. His #1 nephew has one more double string b of length m (m≤n). Mr. Chanek's nephew adores the non-negative integer k. His nephew needs precisely k events of b as substrings in a. Be that as it may, Mr. Chanek doesn't have a clue about the worth of k. Thus, for every k (0≤k≤n−m+1), track down the base number of components in a that must be changed to such an extent that there are by and large k events of b in a.
A string s happens precisely k occasions in t in case there are actually k various sets (p,q) with the end goal that we can get s by erasing p characters all along and q characters from the finish of t.
Input :The primary line contains two integers n and m (1≤m≤n≤500) — size of the double string an and b separately. The subsequent line contains a double string an of length n. The third line contains a double string b of length m.
Output :Output n−m+2 integers — the (k+1)- th integer signifies the insignificant number of components in a that must be changed so there are by and large k events of b as a substring in a.
Step by step
Solved in 4 steps with 1 images