Check if number is power of 2 in one line
Filed under Samsung
The question
Write a single-line code to check whether a given number is a power of 2.
No write-up yet. Related questions below have one.
Related Samsung questions
Collected from public candidate posts and coding forums. Updated Nov 2026.