SUMSUMS getting TLE

getting TLE in last test-case :

help me

what was that pattern in the transformation matrix how to get this

plz don’t send me any other solution. i want to correct my solution only.

thank you

Hello @sutharp777, pls explain your code little bit and tell the pattern which you have found.
I will surely help you out with the logic.

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.

i mean the constraint of this question is too big and it is not possible to solve this even using matrix exponentiation.
I know that there is definitely something tricky there or a pattern that we need to consider. which is, I’m unable to figure it out, that we can reduce the time complexity.