The implemented solution uses the Knuth-Morris-Pratt (KMP) algorithm to find the occurrences of pattern in text. The algorithm first preprocesses the pattern by calculating the longest prefix and suffix that are also a prefix of the pattern. It then uses this information to skip comparisons when searching for the pattern in the text, reducing the time complexity.
The implemented solution uses the Knuth-Morris-Pratt (KMP) algorithm to find the occurrences of pattern in text. The algorithm first preprocesses the pattern by calculating the longest prefix and suffix that are also a prefix of the pattern. It then uses this information to skip comparisons when searching for the pattern in the text, reducing the time complexity.
Code clear Add README All tests are green