Return (base ** exp) % mod where exp can be as large as 10**18. The starter code multiplies exp times, which is far too slow for the big tests. Make it fast.
Example 1
Input:
power_mod(2, 10, 1000)
Output:
24
2**10 = 1024, remainder 24.
Example 2
Input:
power_mod(3, 0, 7)
Output:
1
Anything to the power 0 is 1.
0 <= base < 10**90 <= exp <= 10**181 <= mod <= 10**9 + 7exp times is too slow for the large tests.No results yet
Run your code to check it against the examples, or submit to run every test.