dsa11 min read
KMP Pattern Matching — O(n+m) String Search Every FAANG Interview Tests [LC 28]
LC 28 Find the Index of the First Occurrence in a String is the canonical KMP problem at Google, Meta, and Amazon. Build the failure function in O(m), search in O(n), and never re-examine a matched character again.
Read →