KMP algorithm to solve the problem: optimize the BF (Brute Force) algorithm, avoid backtracking matching of the main string (matching unsuccessful n-1), and the efficiency is low.
KMP algorithm principle/purpose: The main string does not backtrack, that is, the matching pointer points to the mismatch position, and is moved by the substring/pattern string, and the string matching is completed by this pattern.