Special String
You are given a string $S$ and you want to make it $(n,k)$ special. String $A$ is $(n,k)$ special if after concatenating $n$ copies of string $A$ we get at least $k$ substring of $A$ in the resulting string (Overlapping substrings also count). Your task is to find the minimum number of characters you need to alter to make string $S$, $(n,k)$ special. Note : Inputs are given such that it is alw
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start