## Find Pattern And Its Anagrams In A Text

We will be solving here a LeetCode problem. The problem is to find a pattern & all its anagrams in a String. You will find similar problem in InterviewBit or GeeksforGeeks too. Problem: Given two strings s and p, return an array of all the start indices of p’s anagrams in s. You may return … Read more

## KMP Algorithm Explained In Plain English

Update 04/08/2023: We just created a video explanation in Youtube. It is based on the explanation given below. If you prefer audio visual tutorial, you can check it out. Here I am just trying to explain KMP algorithm in plain english. I will also explain worst time complexity & why it is O(m + n). … Read more

## Simple Explanation Of Rabin-Karp Pattern Matching Algorithm

In this post, I will try to explain Rabin-Karp algorithm & its worst time complexity. Rabin-Karp algorithm is based on hash matching.   Let’s take an example. Text: aadabcPattern: abc   Let’s create a table as below & represent each letter with some arbitrary number. We will use it to calculate hash. a b c … Read more