Problem - https://www.geeksforgeeks.org/problem...
Implement pow(x, n) % M.
In other words, for a given value of x, n, and M, find (xn) % M.
Example 1:
Input:
x = 3, n = 2, m = 4
Output:
1
Explanation:
32 = 9. 9 % 4 = 1.
Example 2:
Input:
x = 2, n = 6, m = 10
Output:
4
Explanation:
26 = 64. 64 % 10 = 4