← All problemsSign in

Yet Another Query Problem

We hope you enjoyed the typing test :) Here's a storyless problem to compensate for the time spent on typing tests. Given a string $S$, containing only lowercase English alphabets, you have to answer $Q$ queries. In each query, you will be given a character $C$ and an integer $N$, and you have to calculate the total number of subsequences of $S$ which contain at least $N$ occurrences of characte

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