Swift solution – Getting "Memory Limit Exceeded"?


  • 0
    S

    I'm getting Memory Limit Exceeded for Last executed input: 99980001. Clearly I can't do much about that, but what's going on?

    class Solution {
        func isPowerOfThree(_ n: Int) -> Bool {
            return n > 0 && 1162261467 % n == 0
        }
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.