You are given two strings s and t, and an integer k. Both strings have the same length, which is divisible by k.
You need to divide string s into k equal sized substrings. Determine whether it is possible to rearrange these substrings such that concatenating them in some order produces the string t.
Return true if t can be formed by rearranging the k substrings, or false otherwise.
Constraints:
s.length t.length
k s.length
s.length is divisible by k.
s and t consist only of lowercase English letters.
The input is generated such that s and t are anagrams of each other.
You are given two strings s and t, and an integer k. Both strings have the same length, which is divisible by k.
You need to divide string s into k equal sized substrings. Determine whether it is possible to rearrange these substrings such that concatenating them in some order produces the string t.
Return true if t can be formed by rearranging the k substrings, or false otherwise.
Constraints:
s.length t.length
k s.length
s.length is divisible by k.
s and t consist only of lowercase English letters.
The input is generated such that s and t are anagrams of each other.