Given: A strings contains 1 to K lowercase characters and at most M distinct characters.Find total such possible strings
constraints:
1 <= T <= 25
1 <= K <= 10^9
1 <= M <= 26
Sample input
2
1 1
2 10
Sample Output
26
52
https://www.hackerearth.com/code-hack-5/algorithm/incredible-string/
How to approach this problem?