## Find Pattern And Its Anagrams In A Text

Suppose we need to find if some text contains a pattern or any of its anagrams. I will explain how you can do it in O(n) time. Let’s consider the example below: Text: cedaabd Pattern: abad Here are all possible 4-letter anagrams of abad: aabd aadb abad abda adab adba baad bada bdaa daab daba … Read more