Better than Neetcode's explanation on the same problem, and more simple/ straightforward too! Came here cuz the neetcode one was too confusing and long
After watching 3 other videos, this is the clearest of them all, finally understood this problem. Fantastic explanations, pls don't stop making leetcode videos.
Could someone please explain to me why this is faster than the solution I wrote? def check_inclusion(s1: str, s2: str) -> bool: n1, n2 = len(s1), len(s2) if n1 > n2: return False permutations = Counter(s1) for i in range(n2): if permutations == Counter(s2[i:i + n1]): return True return False