Doubt regarding the constraint of question

It is possible to do matrix exponentian if n is in range of 50000.???

hello @anand_54

no , its not possible to do it using matrix expo for larger N.

becuase time complexity will be N^3 * log(T) ,and N^3 factor is really big

Then how to solve this question ? In hint video explanation is using matrix exponentiation ???

it observation based .
pls refer this->
link1
link2

yeah for small constraint we can use matrix expo, but here constraint are large. . . . .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.