2023-09-20 16:35:10 +0000 UTC
Power of Three
Categories:
Links
Code
class Solution:
def isPowerOfThree(self, n: int) -> bool:
# 3 ** 20
return n > 0 and 3486784401 % n == 0
class Solution:
def isPowerOfThree(self, n: int) -> bool:
# 3 ** 20
return n > 0 and 3486784401 % n == 0