← All problemsSign in

Chef Hates Palindromes

CodeChefRating 1804Open on judge ↗

Chef's birthday is coming soon! His friend Fehc is going to send him a string of length N as a gift. Knowing that Chef doesn't like palindromes, Fehc wants the longest palindromic substring to be as short as possible. The string should only contain the first A latin letters(e.g. let A=2, then this string only contains 'a' and 'b'). Please help Fehc and find such a string. If multiple solution exis

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