FunctionRacerProblemsRace

Power of Four

BeginnerMathPython, JavaScript, TypeScript, Java, C++

Return True if n is a power of 4 (1, 4, 16, 64, ...), otherwise False.

Example 1

n 16
returns true

4 squared.

Example 2

n 8
returns false

8 is a power of 2 but not of 4.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems