Practice Super Pow
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Compute a^b modulo 1337. Here a is a positive integer, and the positive exponent b is supplied as an array of decimal digits in most-significant-first order. For example, b = [1, 0] represents the exponent 10.
Source: Super Pow on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
a = 2, b = [3]
Output
8
# Example 2
Input
a = 2, b = [1,0]
Output
1024
# Example 3
Input
a = 1, b = [4,3,3,8,5,2]
Output
1
Constraints
1 <= a <= 2^31 - 1
1 <= b.length <= 2000
0 <= b[i] <= 9
b does not contain leading zeros.
Related LeetCode Problems
Practice more problems similar to Super Pow.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.