Chef and Pal
Chef just had a big argument with his best friend. He is quite upset and doesn't want anything to remind him of his pal. Chef has to construct a **binary** string $S$ of length $N$. He would like it to be as far from a palindrome as possible, and so he would like $S$ to satisfy the following condition: - Let $T$ be the reverse of $S$. Then, $S_i \neq T_i$ for every $1 \leq i \leq N$. Can you he
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