Skip to content

Instantly share code, notes, and snippets.

@Dipesh-Budhiraja
Dipesh-Budhiraja / kmp.cpp
Created June 28, 2018 14:23
Knuth Morris Pratt(KMP) Pattern Matching
#include <bits/stdc++.h>
using namespace std;
int main(){
string pattern = "ababd";
string target = "ababcabcabababd";
int l = pattern.length();
int t = target.length();
int lps[l+1];