Medium
Permutation in String
Medium
75 submissions
25 coins
+100 XP
Hash Table
Sliding Window
String
Problem Description
Return `true` if some permutation of `s1` appears as a contiguous substring of `s2`.
**Example 1:**
```
Input: s1 = "ab", s2 = "eidbaooo"
Output: true
```
**Example 2:**
```
Input: s1 = "ab", s2 = "eidboaoo"
Output: false
```
**Example 3:**
```
Input: s1 = "adc", s2 = "dcda"
Output: true
```
Constraints
- `1 <= s1.length, s2.length <= 10^4`
- Lowercase English letters only.
Need help?
Connect with expert programmers for real-time collaborative coding, video meetings, and whiteboard sessions via CodeConnect.
Video Call
Whiteboard
Live Coding
Screen Share