Modular exponential

https://ide.codingblocks.com/s/44318

the code is giving wrong answers for some test cases.

Hey Malay, a and b can be equal 100000, therefore a^b can be larger than the range of long long int, So, try to use number theory concepts for solving this problem and don’t use inbuilt power function of stl. Please do refer the online videos of number theory to know more about it.

1 Like