Concept Flow - KMP Pattern Matching Algorithm
Build LPS array for pattern
Start matching text and pattern
Compare characters
First, build the LPS array for the pattern. Then, scan the text comparing characters. On mismatch, use LPS to skip unnecessary comparisons. Repeat until all matches are found or text ends.
