Maximum Palindrome
You are given an integer $N \geq 2$. Construct string $S$ of length $N$ containing only lowercase Latin alphabets, such that - $S$ contains at least $2$ distinct characters. - The number of [circular shifts](https://en.wikipedia.org/wiki/Circular_shift) of $S$ which are [palindromes](https://en.wikipedia.org/wiki/Palindrome) is maximum among all strings of length $N$ containing at least $2$ distin
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