Complete Solution does not follow the Solution Approach


#1

The Java Editorial solution does not return expected value of 1 for “aaabaa”, while the Fastest solution is O(n^2) instead of O(n).

Solutions based on KMP or Rabin-Karp would have O(n) time complexity.