nilsilu95's blog

By nilsilu95, history, 9 years ago, In English

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?

  • Vote: I like it
  • +12
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

how come it is matrix expo?