342. Power of Four

PHOTO EMBED

Thu Mar 02 2023 11:31:45 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

class Solution {
public:
    bool isPowerOfFour(int n) {
        
        if(n==1) return true;
        if(n==0||n%4!=0) return false;
        return isPowerOfFour(n/4);
        
    }
};
content_copyCOPY

https://leetcode.com/problems/power-of-four/