MODULAR EXPONENTIAL: not getting all the testcases right
@sanya2508 Your code is failing for large test cases. You have to print (a^b)mod c. The constraints given are 1<=a,b,c<=100000. So (a^b) can reach a very large value which cannot be handled by the datatype. This is why your code is giving wrong answer for many test cases. You have to handle those cases when a^b reaches a very large value.
So refer this video:
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.