Palindromes Not Allowed
A string $S$ is called *good* if none of the substrings of $S$ of length $\ge 2$ are palindromic. For e.g. $S =$ $\texttt{hello}$ is not good but $S =$ $\texttt{world}$ is good. You are given a string $A$ of length $N$ (containing lowercase Latin letters only). Rearrange $A$ to form a good string or determine it is not possible to do so. Recall that a string is called palindromic if it reads th
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