Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Permutation in String

Python data engineering interview problem. Difficulty: intermediate. Pattern: Sliding Window. About 14 minutes. Part of the Pro drill bank.

Whether s2 contains any permutation of s1 as a substring. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Implement check_inclusion(s1: str, s2: str) -> bool.

Constraints

  • Lowercase letters.

Examples

Input: check_inclusion('ab', 'eidbaooo') Output: True ba is a permutation window.

Topics: lakebench, python, permutation, window.

More Python interview questions · All interview problems · Learn data engineering

intermediate

Permutation in String

Interview-style drill: Whether s2 contains any permutation of s1 as a substring.

Implement `check_inclusion(s1: str, s2: str) -> bool`. Example: `"ab", "eidbaooo"` → `True`. Keep the harness.