← All problemsSign in

Make Palindrome 2

CodeChefRating 1393Open on judge ↗

You are given a binary string $S$ of length $N$. You want to obtain a [palindrome](https://en.wikipedia.org/wiki/Palindrome) from $S$ by applying the following operation **at most** $\left\lfloor \frac{N}{2} \right\rfloor$ times: - Choose an index $i\;(1 \le i \le \lvert S \rvert)$, delete the character $S_i$ from $S$ and concatenate the remaining parts of the string. Here $\lvert S \rvert$ denot

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