KMP Prefix Function & Z Algorithm

Compare two classic linear-time string preprocessing arrays on the same input.

Prefix Function (π)

Z Array