Repeated Substring Pattern: Leetcode tough KMP and Robin Karp Algorithm — Hackrank TOP 20
7 min readJan 4, 2021
https://leetcode.com/problems/repeated-substring-pattern/
Easy But tough for me as I do not know two of the algorithm
1. Knuth-Morris-Pratt Algorithm and
2. Divisors + Rabin-Karp
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of…