File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 3
3
* Power of Two
4
4
**
5
5
* Given an integer n, return true if it is a power of two. Otherwise, return false.
6
- * An integer n is a power of two, if there exists an integer x such that n == 2x .
6
+ * An integer n is a power of two, if there exists an integer x such that n == 2^x .
7
7
*
8
8
* Example 1:
9
9
* Input: n = 1
10
10
* Output: true
11
- * Explanation: 20 = 1
11
+ * Explanation: 2^0 = 1
12
12
*
13
13
* Example 2:
14
14
* Input: n = 16
15
15
* Output: true
16
- * Explanation: 24 = 16
16
+ * Explanation: 2^4 = 16
17
17
*
18
18
* Example 3:
19
19
* Input: n = 3
20
20
* Output: false
21
21
*
22
- * Constraints: -231 <= n <= 231 - 1
22
+ * Constraints: -2^31 <= n <= 2^31 - 1
23
23
*
24
24
* Follow up: Could you solve it without loops/recursion?
25
25
**
You can’t perform that action at this time.
0 commit comments