← All problemsSign in

Swati and Sstrings

Swati loves _Sstrings_. She considers an ordinary string to be a _Sstring_ if it contains the substring ```"SS"```. Now for a given string $S$ and an integer $N$, she creates a new string $S^{\prime} = \underbrace{S + S + \dots + S}_{\text{concatenating} \space N \space \text{times}}$. Swati is a very busy girl, and she doesn't have time to find whether $S^{\prime}$ is a _Sstring_ or not. So she

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start