Optiver Interview Question

In Hackerrank OA, first question was on KMP algorithm, second was on regression