← All problemsSign in

Special String

Mani has a string S and an integer d in hand. He has to deal with special strings now :( . A string is a special string if the length of its Longest Palindromic Substring is less than d. He needs to find the lexicographically smallest special string X among all special strings which are lexicographically larger than S If there is no possible value of X, print "Impossible"(without quotes) Input

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