Power of Two

Easy Solved

Description

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

An integer is a power of two if there exists an integer x such that n == 2x.

Input format / Clarification:

  • Line 1: Integer n

Examples

Input:
1
Output:
true
Input:
16
Output:
true
Input:
3
Output:
false

Note:

Your program must print true or false so it can be compared with the expected output.

Your Submissions

No submissions yet.

Discuss

Discuss bit manipulation, logarithmic checks, and edge cases like zero or negatives.

Test Cases