Sliding WindowMedium
Permutation in String
Return true if some contiguous part of text uses exactly the letters of pattern, in any order.
Example 1pattern = "ab", text = "xxbax" → true"ba" is in the text.
Example 2pattern = "ab", text = "axxb" → false
1 ≤ lengths ≤ 10⁴ · lowercase English letters