title: KMP failure function calculation
body: <p>My professor solved the kmp failure function as follows:</p>
  
  <pre><code>index  1 2 3 4 5 6 7 8 9
  string a a b a a b a b b
  ff     0 1 2 1 2 3 4 5 1
  </code></pre>
  
  <p>From other texts I checked online, I found out it might be wrong, I went back to confirm from him again and he told me he's absolutely right. Can someone pls explain to me why he thinks it's right or wrong in a simple step by step manner? Thanks</p>