Problem 3365 · Medium

Rearrange K Substrings to Form Target String

Split s into k equal blocks, put them in a bag, and check that t can take every block out of the bag exactly.

Open the interactive visualisation