Say we are given the number of occurrences of each letter (lower case english alphabet). We have to find the number of all k length strings (unique) that can be formed using these letters (MOD 1e9 +7).
Example: a:2, b:1, c:1
k = 2
aa ab ac bc ca cb ba
Answer: 7
Constraints:
k <= 1e5
Total number of characters <= 1e5
I couldn't solve it. Any input is appreciated.