5. KMP algorithm is a rapid method to perform pattern matching
operation. First, we need to define a failure function for a pattern. The
following definition is used to determine the failure function:

a. Suppose that we have a pattern shown below, to give the failure
function of the pattern for each character. (15%)
a b a b b a b a b a b