← All problemsSign in

Delete substring

You have a String S with you.You can apply the following operation on the string any number of times you want. 1.Pick 2 non-overlapping substrings S1 and S2 such that S1==S2. Delete either S1 or S2. Your task is to obtain the typographically smallest possible string. Definition of typographically smaller string : 1.If Size(X) < Size(Y) then X is typographically smaller than Y. 2.If Si

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