← All problemsSign in

RK and his partition method

RK was playing with Strings. One day he came across the following problem. He wanted to find the number of ways to split a string S to substrings such that if there are k substrings (p1, p2, p3, ..., pk) in partition, then pi = pk-i+1  for all i (1 ≤ i ≤ k) and k is even. Since the number of ways can be very large, print it modulo 109 + 7. Input - The only line of the input consist of a string

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