Question DSA-MATH-0042
MediumWhat is the output of this code?
def power(a, b, m):
r = 1
a %= m
while b:
if b & 1:
r = r * a % m
a = a * a % m
b >>= 1
return r
print(power(3, 200, 13))
- A.
9
- B.
1
- C.
Sign up free to see the answer and a step-by-step explanation.