Power of Two
Given an integer n, return true if it is a power of two. Otherwise, return false.

30:00

Power of Two
easy
Topics
Companies

Given an integer n, return true if it is a power of two. Otherwise, return false.

Example 1:
Input: 16
Output: true
Constraints:
  • 231n2311-2^{31} \leq n \leq 2^{31} - 1

Input
arr =16

Check power of 2

n

16

000028000024000020000016000012000080001400000
Variables
VariableValue
n16
DepthFunction Call
Stack empty
0/2