Ayush and Strings
CodeChefOpen on judge ↗
While making the problems for Heritage Utsav, Trijeet came across an interesting string $S$ of length $N$. When Ayush saw the string he liked it very much. He liked it so much that now he wants a string $T$ such that $T$ contains the original string $K$ times as a substring. Also, he does not like long strings and would love it to be as small as possible. Trijeet does not know how to generate
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