I want to solve a problem and I need some help because my code doesn't work.
Ok, so I have a sequence S(input data) and I need to find the number of subsequences such that a subsequence number of distinct characters must be equal with K (input data)
Example:
For S = abcaa and K = 3, the answer is 5.
s1 = abc
s2 = abca
s3 = abcaa
s4 = bca
s5 = bcaa
I was thinking a little and I look on internet for some answers but I don't find what I really want. So, I think that i must find frequency of every character in sequence, but I don't know what to do after this...