Permutation in String
Medium
LC #567
stringfixed windowcountingNot attempted yet
Given two lowercase strings s1 and s2, return
True if some rearrangement of s1 appears in
s2 as a contiguous substring, otherwise False.
Example 1
Input: s1 = "ab", s2 = "eidbaooo"
Output: True
"ba" appears at index 3.
Example 2
Input: s1 = "ab", s2 = "eidboaoo"
Output: False
Example 3
Input: s1 = "adc", s2 = "dcda"
Output: True
"cda" is a rearrangement of "adc".
Constraints
- 1 ≤ len(s1), len(s2) ≤ 10^5
- Only lowercase English letters.