Repeated Substring Pattern: Leetcode tough KMP and Robin Karp Algorithm — Hackrank TOP 20

Amber Ivanna Trujillo
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…

--

--

Amber Ivanna Trujillo

I am Executive Data Science Manager. Interested in Deep Learning, LLM, Startup, AI-Influencer, Technical stuff, Interviews and much more!!!