As you know from the theory, the KMP algorithm is more efficient than the naive approach in substring searching.
Given the pattern and the string . Calculate the number of shifts made while using the KMP algorithm to search for the presence of in . Do not count as a shift the first step when the substring is positioned at the beginning of the string .
Note that the naive algorithm would perform shifts until is found, meanwhile KMP performs significantly fewer shifts. How many?