class Solution: def superPow(self, a: int, b: List[int]) -> int: if a == 1: return a b.sort(reverse=True) max_num = int("".join([str(x) for x in b])) return pow(a, max_num, 1337)