You are given a string $$$s$$$ of length $$$n$$$. Determine if all subsequences of $$$s$$$ that have length $$$k$$$ are unique.
A subsequence of $$$s$$$ is defined as a sequence that can be obtained from $$$s$$$ by deleting some elements (possibly none), without changing the order of the remaining elements.
For instance, the subsequences of $$$trust$$$ of length $$$4$$$ are $$$trus$$$, $$$trut$$$, $$$trst$$$, and $$$rust$$$, all of which are unique.
But when considering subsequences of $$$threes$$$ of length $$$4$$$. The subsequence $$$tres$$$ occurs twice ($$$\underline{t}h\underline{re}e\underline{s}$$$ and $$$\underline{t}h\underline{r}e\underline{es}$$$).
The first line of input contains a single integer $$$T$$$ denoting the number of test cases $$$(1 \leq T \leq 10^3)$$$.
The first line of each test case contains two integers $$$n \ k$$$ denoting the length of the string and the length of subsequences to consider $$$(1 \leq k \leq n \leq 10^5)$$$.
The second line contains a string $$$s$$$ of length $$$n$$$ consisting only of lowercase English letters.
It is guaranteed that the sum of $$$n$$$ across all test cases does not exceed $$$3 \cdot 10^5$$$.
—
Tests in subtasks are numbered from $$$1 - 10$$$ with samples skipped. Each test is worth $$$\frac{100}{10} = 10$$$ points.
Tests $$$1 - 3$$$ satisfy $$$n \leq 10$$$.
Tests $$$4 - 5$$$ satisfy that the sum of $$$n$$$ across all test cases does not exceed $$$3366$$$.
The remaining tests do not satisfy any additional constraints.
For each test case, output "Yes" (without the quotes) if all subsequences of length $$$k$$$ are unique or "No" (without the quotes) otherwise.
115 4trust6 4threes6 4abcdba8 4sendhelp9 8imtrapped7 6inabase9 5mentuntil7 1ifinish9 7preparing8 3problems8 8heeeeelp
Yes No Yes No No Yes No No Yes Yes Yes
It can be proven that all $$$15$$$ subsequences of length $$$4$$$ of $$$abcdba$$$ are unique (by listing them out and reading over them carefully). Also I'm trapped in Tho$$$[$$$deleted$$$]$$$
—
Problem Idea: dutin
Problem Preperation: 3366
Occurrences: Novice 6, Advanced 3