← All problemsSign in

Nehru Gift

Jawaharlal Nehru loves to write poems so on Gandhi's birthday he wrote a poem for Gandhiji consisting of $N$ lines (each line is string with lowercase alphabets **'a'**, **'b'**, **'c'**, **'d'**, **'e'**) and gave it to him. But he had a doubt whether Gandhiji had read the poem or not so he took a test of him. In the test he asked $Q$ queries and in each query a string is provided. For each query

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