The origin problem is here. Now it is deleted.
Suppose I have 3 'available' copies of
a, 2 of
b, 3 of
c, and 4 of
- I want to know the number of different strings with length $l$ using these characters (but no more than the available copies).
- Is there an efficient (i.e. $o(k)$) algorithm for computing the $k$-th smallest string of length $l$ in lexicographic order?
For example, The first string of length 1 is
a, the second string of length 3 is
aab, the 5th string of length 5 is
What kind of algorithm or math can I use to calculate?