# Question

Formatted question description: https://leetcode.ca/all/372.html

 372	Super Pow

where a is a positive integer and b is an extremely large positive integer given in the form of an array.

Example 1:

Input: a = 2, b = [3]
Output: 8

Example 2:

Input: a = 2, b = [1,0]
Output: 1024



# Algorithm

Related maths

        a^b % 1337 = (a%1337)^b % 1337

xy % 1337 = ((x%1337) * (y%1337)) % 1337



Reduced by half, the difference is that the remainder of 1337 is added. Since the given exponent b is a representation of a one-dimensional array, it must be very inconvenient to deal with it if we halve it.

So we use bitwise processing, such as 2^23 = (2^2)^10 * 2^3, so we can start from the highest bit of b, calculate a result and store it in res, and then go to the next bit , The tenth power of res is multiplied by the power of a and the remainder is 1337.

Java