Modulo Exponentiation

The code is failing for some testcases.
I have used the properties of modulo to reduce time complexity.
Link to code : https://ide.codingblocks.com/s/199723

@Chirag-Jain-1414278322030453
You have provided the code for bubble sort? Please check the link.

Don’t know what happened.

Here is the link : https://ide.codingblocks.com/s/199744

all test cases passes just test case 0 failed using the code in your link. Have we missed some other base case?