← All problemsSign in

String Counter

Consider a string S of N characters where each character is indexed from 0 to N-1 You are given with Q cases; each containing 2 numbers a , b as the range of indices from the string S You have to find the number of different sub strings from the string S inside the range including a and b ## INPUT FORMAT The first line has 2 numbers giving the value of N and Q The second line has the s

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