You are given A, B and C . Calculate the value of (A ^ B) % C
1 <= A <= 109
0 <= B <= 105
1 <= C <= 109
Given three integers A, B and C.
Return an integer.
Input 1: A = 2 B = 3 C = 3
Input 2: A = 5 B = 2 C = 4
Output 1: 2
Output 2: 1
For Input 1: (2 ^ 3) % 3 = 8 % 3 = 2
For Input 2: (5 ^ 2) % 4 = 25 % 4 = 1