← All problemsSign in

FRIENDSHIP IN WONDERLAND

In Wonderland, everyone has their own non-empty personal string. When two people with personal strings F1 and F2 (possibly identical) become friends in wonderland,their strings are replaced by a new string S=F1+F1+F2+F2, where + denotes concatenation. Light recently became friends with Misa. But, Misa's personal string was her favourite and she got upset when it was replaced by S. She want

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