https://ide.codingblocks.com/s/72026.In this ide only 4 test cases are passed except it other test cases gives wrong answer.
Regarding Modular Exponentiation assignment
@raushan.raman23011999 you are not doing modular exponentiation properly.there is some changes required in your code
at line 10
ans=(anst)%m;
at line 12
t=(tt)%m;
and all looks goods
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.
Can you please explain why we are taking mod at every step ? i know the property (ab)%m = ((a%m)(b%m))%m .
But i am not able to relate this mod multiple property to the provided code. i dont want to mug up the code