Dsa
Bit Manipulation
Warm-up
Power of Two
Determine if a given integer N is a power of two.
Input format:
- A single integer N (-2^31 <= N <= 2^31 - 1)
Output format:
- Print 'Yes' if N is a power of two, otherwise print 'No'.
Example:
Input:
8
Output:
Yes
(Note: 8 is 2^3, which is a power of two.)
Key concepts
bit manipulationpowers
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