Given an integer n, return true if it is a power of two.
Input: n=1 Output: true (2^0) Input: n=16 Output: true (2^4) Input: n=3 Output: false
Unlock hints progressively — start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features