2023-09-20 16:35:10 +0000 UTC

Power of Three

Code

class Solution:
    def isPowerOfThree(self, n: int) -> bool:
        #                3 ** 20
        return n > 0 and 3486784401 % n == 0