Search
⌘K

Leetcode 3365. Rearrange K Substrings to Form Target String

Given anagram strings s and t and an integer k (with |s| divisible by k), determine whether you can split s into k equal-length contiguous substrings and permute those substrings to form t. The core challenge is to check whether the multisets of length-|s|/k substrings obtained from s and t are identical (efficiently, since |s| can be up to 2e5).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.