ASAPUtils Logo ASAPUtils
Week 2

Permutation in String

Permutation in String with a fixed-size sliding window and character counts, with C++ and JavaScript solutions, a visualizer, and the O(1) match-counter optimisation.

The problem

Given two strings s1 and s2, return true if s2 contains a permutation of s1 as a contiguous substring.

s1 = "ab", s2 = "eidbaooo" -> true ("ba" at index 3)

Related Problems