title: KMP's failure function
body: <p>I've recently learnt the KMP string matching algorithm, and I almost get all of it. But what I don't get is how to build the failure function in O( <b><i>length_of_pattern</i></b> ). I <strong>don't</strong> need code, I need a clear explanation if possible. Thanks in advance!</p>