15. Permutation in String
Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string.
Solution I: (Pattern matching similar to Rabin Karp)
Time Complexity: O(n1 + (n2-n1) * 26)
Solution II: (Optimized )
Previous14. Find All Anagrams in a StringNext16. Maximum Number of Vowels in a Substring of Given Length
Last updated