x-string
CodeChefOpen on judge ↗
kennyS and Shoxie are back with a new game. This time, Shoxie gives kennyS a string S. It consists of only lowercase English letters. Since Shoxie loves palindromes a lot, he lets kennyS insert any number of character ‘x’ in the string anywhere (including the beginning and ending index). Help kennyS turn the given string S into a palindrome by inserting minimum number of ‘x’s (maybe 0). If he can’
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