Mehta and charming strings
CodeChefOpen on judge ↗
After finishing his work for the day, Mehta started examining some strings for fun. While doing this, he figured out that the charming value of a substring is directly proportional to the length of the substring provided that the length of the substring doesn't exceed a particular value otherwise that substring is considered repulsive. Since Mehta is very fond of palindromes, he wants to compute
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