← All problemsSign in

Strings and Queries

Mr. Seth loves to play with strings, so he provides you a string $S$ of lowercase alphabets and a positive integer $Q$. You have to process $Q$ queries of following two types: - $1$ $L$ $X$ - change the character at index $L$ to $X$. ($1$-based indexing) - $2$ $K$ - print the $K^{th}$ largest frequency character in string $S$, if it exists otherwise print $-1$. **Note:** If there exists

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