A subsequence of a word is obtained by dropping some letters from it. The letters that are dropped need not be consecutive. For instance, ba, bna and banaa are all sub-sequences of the word banana.
We are interested in counting the number of distinct sub-sequences of a fixed length of a given word. For example, the word banana has 11 different sub-sequences of length 3: {aaa, aan, ana, ann, baa, ban, bna, bnn, naa, nan, nna}.
For the word "tinnitus", how many different sub-sequences of length 3 does it have?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Since it is a CS problem, I solved it a CS way using Python. No good at it, I did as follows: