Implemented the KMP search function with brief description