Power of two
easyMaths and loops10 XP
Return whether n is a power of two (1, 2, 4, 8, …).
Examples
- Input: n = 16Output: true
- Input: n = 12Output: false
Examples use JSON: true/false/null are True/False/None in Python.
Return whether n is a power of two (1, 2, 4, 8, …).
Examples use JSON: true/false/null are True/False/None in Python.
Run examples checks the examples above. Submit also runs 5 hidden tests.