← All problemsSign in

K - Unique Subsequences Counting

An array $A$ of length $N$ is said to be *good* if and only if every subsequence of length $M$ appears at most once in the array. For example, $A = [1, 2, 2]$ is not *good* with length parameter $M = 2$, because the subsequence $[1, 2]$ appears twice. On the other hand, it would be *good* with length parameter $M = 3$. Given $N$ and $M$, count the number of arrays $A$ satisfying the following c

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