Intuition of Knuth, Morris & Pratt

The Knuth-Morris-Pratt (KMP) algorithm is a fast string search algorithm that attempts to find a pattern P inside a text T. It was somewhat…