Dsa
Bit Manipulation
Medium
Check Power of Four
You are tasked with determining if a given integer `n` is a power of four. An integer is a power of four if it can be expressed as 4^k for some integer k (k >= 0). Your function should return True if `n` is a power of four, otherwise return False.
For example:
Input:
16
Output:
True
Explanation: 4^2 = 16, so 16 is a power of four.
Key concepts
bit manipulationmathematics
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now