← All problemsSign in

COC battle

Nanu, a Clash of Clans player is so much obsessed with the game and its new update. She wants to win as much battles as she can. Each of the enemy clan has N troops of lowercase letters. And for the attack she takes an army of length M. In the new update win is given when first k troops she takes, can kill any of the k consecutive troops of the clan. Remember a troop of type 'a' can only kill

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