Блог пользователя nilsilu95

Автор nilsilu95, история, 9 лет назад, По-английски

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?

  • Проголосовать: нравится
  • +12
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

how come it is matrix expo?