4 - Palindrome and antipalindrome
CodeChefOpen on judge ↗
Say that a string is ***binary*** if it consists solely of the symbols $0$ and $1$ (the empty string is binary too). For a binary string $s$ let's define two functions: - The function $rev(s)$ reverses the string $s$. For example, $rev(010111)=111010$ and $rev(01)=10$. - The string $flip(s)$ changes each character in $s$ from $0$ to $1$ or from $1$ to $0$. For example, $flip(010111)=101000$ an
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