#567
Permutation in String
specialist · 890 · lc medium +31 · verified · 48.5% accepted · 12,935 likes · top 34%
Description
Given strings s1 and s2, return true if any anagram (rearrangement) of s1 appears as a contiguous substring of s2, or false otherwise.
Example 1:
Input: s1 = "ab", s2 = "eidbaooo"
Output: true
Explanation: s2 contains one permutation of s1 ("ba").
Example 2:
Input: s1 = "ab", s2 = "eidboaoo"
Output: false
Code
1
2
3