This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sarah, a dedicated mathematician and puzzle enthusiast, stumbled upon an intriguing challenge while delving into her research. | |
She contemplated the creation of an IsPowerOfTwo function, which takes a positive integer n as an argument and aims to discern whether | |
the given number qualifies as a power of two. In mathematical terms, an integer n is deemed a power of two if it can be represented as 2 | |
raised to an integer exponent. For example, 8 is a power of two because it can be written as 2³. | |
*/ | |
module.exports = { isPowerOfTwo }; | |
function isPowerOfTwo(n) { | |