Tandem
The chef was recently studying about repeated occurrences of substrings in the strings. In particular, he was studying about a string s. He calls a string to be in tandem if it can be represented as concatenation of three equal strings, i.e. it can be represented as AAA where A is a non-empty string. For brevity, he calls such strings tandem strings. For example, "ababab" is a tandem string where
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