mHi, I am solving SuperClimber with matrix multiplication...
I am getting Memory limit exceeded on 21 & 22 test but I don't know why...
Can anybody help?
sprobably cause you're creating a new matrix in each of your recursion calls
. try powering it using the bitwise operations, or you can use the recursion with a pointer to the original matrix.
pYeah, you don't even need recursion :) Powering can be done with simple loop also
drecursion is ok, just u r returning always matrix and it's too many memory ...
try to change it to void ...
mThanks :D
I changed powering and removed unnecessary mod operations and it passed...