Back to DSA
Power of Two
mediumDetermine whether a given integer is an exact power of two. An integer n qualifies if there exists some non-negative integer k such that 2^k equals n.
Examples
Example 1:
Input:
n = 8Output:
true Example 2:
Input:
n = 10Output:
falseHints
1234567