Concept Flow - KMP Pattern Matching Algorithm
Build LPS array for pattern
Start matching text and pattern
Compare characters
↩Return index Repeat until text ends
First build the LPS array for the pattern, then scan the text comparing characters. On mismatch, use LPS to shift pattern efficiently.
