Skip to content

[372] Super Pow

https://leetcode.com/problems/super-pow/description/

  • algorithms
  • Medium (35.15%)
  • Source Code: 372.super-pow.py
  • Total Accepted: 26.9K
  • Total Submissions: 75.7K
  • Testcase Example: '2\n[3]'

Your task is to calculate ab mod 1337 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

python
class Solution(object):
    def superPow(self, a, b):
        """
        :type a: int
        :type b: List[int]
        :rtype: int
        """

Last updated: