Skip to main content
Permutation in String | AlgoCracked
AlgoCracked
ProblemsPermutation in String
Medium45.0% acceptance
StringSliding WindowHash TableTwo Pointers

Permutation in String

Given two strings s1 and s2 , return true if s2 contains a permutation of s1 as a substring — that is, some contiguous block of s2 uses exactly the same letters (with the same multiplicities) as s1 . Input format Input is [s1, s2] , e.g. [ ab , eidbaooo ] .

Loading workspace…